Skip to content

Commit

Permalink
Update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklul committed May 3, 2024
1 parent 0807799 commit 7d55749
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ echo "Copying configuration files..."

echo "Copying web files..."
cp -frv "$WEB_PATH"/* "$DESTINATION_DIR/opt/share/pihole/www/admin"
rm -f "$DESTINATION_DIR/opt/share/pihole/www/admin/"*.md
rm -f "$DESTINATION_DIR/opt/share/pihole/www/admin/"*.json

echo "Copying FTL binary..."
cp -fv "$FTL_PATH/pihole-FTL" "$DESTINATION_DIR/opt/sbin/pihole-FTL"
Expand All @@ -79,6 +81,15 @@ echo "Setting execution permissions..."
chmod -v 755 "$DESTINATION_DIR/opt/sbin/pihole-FTL" "$DESTINATION_DIR/opt/sbin/pihole" "$DESTINATION_DIR/opt/etc/init.d/S55pihole-FTL"
find "$DESTINATION_DIR/opt/share/pihole" -type f -name "*.sh" -exec chmod 0755 {} \;

if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/macvendor.db" ]; then
echo "Downloading macvendor.db..."

if ! curl -sSL "https://ftl.pi-hole.net/macvendor.db" -o "$DESTINATION_DIR/opt/etc/pihole/macvendor.db"; then
echo "Error: Could not download macvendor.db"
exit 1
fi
fi

if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/versions" ]; then
echo "Creating versions file..."

Expand All @@ -98,22 +109,13 @@ if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/versions" ]; then
done
fi

if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/macvendor.db" ]; then
echo "Downloading macvendor.db..."

if ! curl -sSL "https://ftl.pi-hole.net/macvendor.db" -o "$DESTINATION_DIR/opt/etc/pihole/macvendor.db"; then
echo "Error: Could not download macvendor.db"
exit 1
fi
fi

#shellcheck disable=SC2034
SKIP_INSTALL=true # Allows sourcing installer without running it
#shellcheck disable=SC1091
source "$CORE_PATH/automated install/basic-install.sh"

if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/dns-servers.conf" ]; then
echo "Creating dns-servers.conf..."
echo "Creating dns-servers.conf file..."

if [ -z "$DNS_SERVERS" ]; then
echo "Error: Could not load DNS_SERVERS variable from basic-install.sh"
Expand All @@ -124,7 +126,7 @@ if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/dns-servers.conf" ]; then
fi

if [ ! -f "$DESTINATION_DIR/opt/etc/pihole/adlists.list" ]; then
echo "Creating adlists.list..."
echo "Creating adlists.list file..."

#shellcheck disable=SC2034
adlistFile="$DESTINATION_DIR/opt/etc/pihole/adlists.list"
Expand Down

0 comments on commit 7d55749

Please sign in to comment.