diff --git a/scripts/build.sh b/scripts/build.sh index 73ea46c4..dbd556af 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -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" @@ -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..." @@ -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" @@ -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"