From e533b883cdbfa7d89df0fa3de7adce0ac31255ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Wed, 20 Mar 2024 18:59:49 +0100 Subject: [PATCH] fix upgrade, create conf template setupVars.conf --- conf/setupVars.conf | 8 + scripts/install | 19 +-- scripts/upgrade | 393 ++++++++++++++------------------------------ 3 files changed, 133 insertions(+), 287 deletions(-) create mode 100644 conf/setupVars.conf diff --git a/conf/setupVars.conf b/conf/setupVars.conf new file mode 100644 index 0000000..f177353 --- /dev/null +++ b/conf/setupVars.conf @@ -0,0 +1,8 @@ +PIHOLE_INTERFACE=__MAIN_IFACE__ +IPV4_ADDRESS=127.0.0.1 +IPV6_ADDRESS=::1 +PIHOLE_DNS_1= +PIHOLE_DNS_2= +QUERY_LOGGING=__QUERY_LOGGING_STR__ +INSTALL_WEB=true +BLOCKING_ENABLED=true diff --git a/scripts/install b/scripts/install index 1f4f8eb..63cc6a3 100644 --- a/scripts/install +++ b/scripts/install @@ -20,6 +20,9 @@ main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') # Get the dnsmasq user to set log files permissions dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2) +# Find the IP associated to the network interface +localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) + if [ "$query_logging" -eq 1 ]; then query_logging_str=true else @@ -83,21 +86,10 @@ ynh_script_progression --message="Installing $app's configuration files..." --we install -d -m 0755 "$PI_HOLE_CONFIG_DIR" ynh_add_config --template="dns-servers.conf" --destination="$PI_HOLE_CONFIG_DIR/dns-servers.conf" ynh_add_config --template="pihole-FTL.conf" --destination="$PI_HOLE_CONFIG_DIR/pihole-FTL.conf" +ynh_add_config --template="setupVars.conf" --destination="$PI_HOLE_CONFIG_DIR/setupVars.conf" chmod 644 "${PI_HOLE_CONFIG_DIR}/dns-servers.conf" -{ - echo "PIHOLE_INTERFACE=$main_iface" - echo "IPV4_ADDRESS=127.0.0.1" - echo "IPV6_ADDRESS=::1" - echo "PIHOLE_DNS_1=" - echo "PIHOLE_DNS_2=" - echo "QUERY_LOGGING=$query_logging_str" - echo "INSTALL_WEB=true" - echo "BLOCKING_ENABLED=true" -} > "$PI_HOLE_CONFIG_DIR/setupVars.conf" -ynh_store_file_checksum --file="$PI_HOLE_CONFIG_DIR/setupVars.conf" - #================================================= # SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE #================================================= @@ -120,9 +112,6 @@ ynh_exec_warn_less "$PI_HOLE_INSTALL_DIR/gravity.sh" --force #================================================= ynh_script_progression --message="Configuring DNS for the local domains..." --weight=7 -# Find the IP associated to the network interface -localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) - # List all YunoHost domains while read -r perdomain; do # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. diff --git a/scripts/upgrade b/scripts/upgrade index 138022d..81e7a2b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,44 +8,23 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# LOAD SETTINGS +# INITIALIZE AND STORE SETTINGS #================================================= -#REMOVEME? ynh_script_progression --message="Loading installation settings..." --weight=3 -#REMOVEME? app=$YNH_APP_INSTANCE_NAME +# Get the default network interface +main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') -#REMOVEME? domain=$(ynh_app_setting_get --app=$app --key=domain) -#REMOVEME? path=$(ynh_app_setting_get --app=$app --key=path) -#REMOVEME? admin=$(ynh_app_setting_get --app=$app --key=admin) -#REMOVEME? query_logging=$(ynh_app_setting_get --app=$app --key=query_logging) -#REMOVEME? #REMOVEME? install_dir=$(ynh_app_setting_get --app=$app --key=install_dir) -#REMOVEME? enable_dhcp=$(ynh_app_setting_get --app=$app --key=enable_dhcp) -#REMOVEME? port=$(ynh_app_setting_get --app=$app --key=port) -#REMOVEME? pihole_version="$(ynh_app_setting_get --app=$app --key=pihole_version)" +# Get the dnsmasq user to set log files permissions +dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2) -#REMOVEME? overwrite_setupvars=$(ynh_app_setting_get --app=$app --key=overwrite_setupvars) -#REMOVEME? overwrite_ftl=$(ynh_app_setting_get --app=$app --key=overwrite_ftl) +# Find the IP associated to the network interface +localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." --weight=1 - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -#REMOVEME? ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=7 - -# Backup the current version of the app -#REMOVEME? ynh_backup_before_upgrade -#REMOVEME? ynh_clean_setup () { - # Restore it if the upgrade fails -#REMOVEME? ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -#REMOVEME? ynh_abort_if_errors +if [ "$query_logging" -eq 1 ]; then + query_logging_str=true +else + query_logging_str=false +fi #================================================= # ACTIVATE MAINTENANCE MODE @@ -56,81 +33,6 @@ ynh_script_progression --message="Activating maintenance mode..." --weight=1 ynh_maintenance_mode_ON -#================================================= -# STANDARD UPGRADE STEPS -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 - -# If overwrite_setupvars doesn't exist, create it -if [ -z "$overwrite_setupvars" ]; then - overwrite_setupvars=1 - ynh_app_setting_set --app=$app --key=overwrite_setupvars --value=$overwrite_setupvars -fi - -# If overwrite_ftl doesn't exist, create it -if [ -z "$overwrite_ftl" ]; then - overwrite_ftl=1 - ynh_app_setting_set --app=$app --key=overwrite_ftl --value=$overwrite_ftl -fi - -# If pihole_version doesn't exist, create it -if [ -z "$pihole_version" ]; then - pihole_version="Last 3.X" - ynh_app_setting_set --app=$app --key=pihole_version --value="$pihole_version" -fi - -#================================================= -# CREATE DEDICATED USER -#================================================= -#REMOVEME? ynh_script_progression --message="Making sure dedicated system user exists..." --weight=1 - -# Create a dedicated user (if not existing) -#REMOVEME? ynh_system_user_create --username=$app --home_dir="$install_dir" - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=4 - ynh_setup_source --dest_dir="$PI_HOLE_LOCAL_REPO" --source_id="pi-hole_Core" - ynh_setup_source --dest_dir="$install_dir" --source_id=pi-hole_AdminLTE - FTL_temp_path=$(mktemp -d) - ynh_setup_source --dest_dir="$FTL_temp_path" --source_id="pi-hole_FTL" -fi - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - -#================================================= -# UPGRADE DEPENDENCIES -#================================================= -#REMOVEME? ynh_script_progression --message="Upgrading dependencies..." --weight=6 - -#REMOVEME? ynh_install_app_dependencies $pkg_dependencies - -#================================================= -# PHP-FPM CONFIGURATION -#================================================= - -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=3 -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - -#================================================= -# NGINX CONFIGURATION -#================================================= - -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC UPGRADE #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -139,141 +41,132 @@ ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=pihole-FTL --action="stop" --log_path="/var/log/pihole-FTL.log" #================================================= -# UPDATE PIHOLE-FTL +# ENSURE DOWNWARD COMPATIBILITY #================================================= +ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading PiHole-FTL..." --weight=35 - - # Instead of downloading a binary file, we're going to compile it - ( - cd "$FTL_temp_path" - ynh_exec_warn_less cmake . - ynh_exec_warn_less make - ynh_exec_warn_less make install - ) - ynh_secure_remove --file="$FTL_temp_path" +# If overwrite_setupvars doesn't exist, create it +if [ -z "${overwrite_setupvars:-}" ]; then + overwrite_setupvars=1 + ynh_app_setting_set --app="$app" --key="overwrite_setupvars" --value="$overwrite_setupvars" fi +# If overwrite_ftl doesn't exist, create it +if [ -z "${overwrite_ftl:-}" ]; then + overwrite_ftl=1 + ynh_app_setting_set --app="$app" --key="overwrite_ftl" --value="$overwrite_ftl" +fi + +# If pihole_version doesn't exist, create it +if [ -z "${pihole_version:-}" ]; then + pihole_version="Last 3.X" + ynh_app_setting_set --app="$app" --key="pihole_version" --value=""$pihole_version"" +fi + +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= +ynh_script_progression --message="Upgrading source files..." --weight=4 + +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --source_id="pi-hole_core" --dest_dir="$PI_HOLE_LOCAL_REPO" +ynh_setup_source --source_id="pi-hole_web" --dest_dir="$install_dir/web" +ynh_setup_source --source_id="pi-hole_ftl" --dest_dir="$install_dir/ftl" + +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" + +touch /var/log/{pihole,pihole-FTL}.log +chmod 644 /var/log/{pihole,pihole-FTL}.log +chown "$dnsmasq_user:root" /var/log/{pihole,pihole-FTL}.log + +#================================================= +# UPGRADE OF PIHOLE-FTL +#================================================= +ynh_script_progression --message="Rebuilding PiHole-FTL..." --weight=30 + +# Instead of downloading a binary file, we're going to compile it +pushd "$install_dir/ftl" + ynh_exec_warn_less cmake . + ynh_exec_warn_less make + ynh_exec_warn_less make install +popd +ynh_secure_remove --file="$install_dir/ftl" + #================================================= # UPDATE THE SCRIPTS #================================================= -ynh_script_progression --message="Updating the scripts..." --weight=1 +ynh_script_progression --message="Upgrading Pihole..." --weight=1 -pushd "${PI_HOLE_LOCAL_REPO}" - install -o "${app}" -Dm755 -d "${PI_HOLE_INSTALL_DIR}" - install -o "${app}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" gravity.sh - install -o "${app}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./advanced/Scripts/*.sh - install -o "${app}" -Dm755 -t "${PI_HOLE_INSTALL_DIR}" ./advanced/Scripts/COL_TABLE - install -o "${app}" -Dm755 -t "${PI_HOLE_BIN_DIR}" pihole - install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole -popd +install -o "$app" -Dm755 -d "$PI_HOLE_INSTALL_DIR" +install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/gravity.sh" +install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts"/*.sh +install -o "$app" -Dm755 -t "$PI_HOLE_INSTALL_DIR" "$PI_HOLE_LOCAL_REPO/advanced/Scripts/COL_TABLE" +install -Dm644 -t /etc/bash_completion.d/pihole "$PI_HOLE_LOCAL_REPO/advanced/bash-completion/pihole" + +install -o "$app" -Dm755 -t "$PI_HOLE_BIN_DIR" "$PI_HOLE_LOCAL_REPO/pihole" #================================================= # UPDATE THE CONFIGS #================================================= -ynh_script_progression --message="Updating the configs..." --weight=1 - -install -d -m 0755 ${PI_HOLE_CONFIG_DIR} - -cp -f "../conf/dns-servers.conf" "$PI_HOLE_CONFIG_DIR/dns-servers.conf" -chmod 644 "${PI_HOLE_CONFIG_DIR}/dns-servers.conf" +ynh_script_progression --message="Updating $app's configuration files..." --weight=1 +install -d -m 0755 "$PI_HOLE_CONFIG_DIR" +ynh_add_config --template="dns-servers.conf" --destination="$PI_HOLE_CONFIG_DIR/dns-servers.conf" # Overwrite pihole-FTL config file only if it's allowed -if [ $overwrite_ftl -eq 1 ] -then - ynh_add_config --template="../conf/pihole-FTL.conf" --destination="$PI_HOLE_CONFIG_DIR/pihole-FTL.conf" +if [ "$overwrite_ftl" -eq 1 ]; then + ynh_add_config --template="pihole-FTL.conf" --destination="$PI_HOLE_CONFIG_DIR/pihole-FTL.conf" +fi +# Overwrite the setupVars config file only if it's allowed +if [ "$overwrite_setupvars" -eq 1 ]; then + ynh_add_config --template="setupVars.conf" --destination="$PI_HOLE_CONFIG_DIR/setupVars.conf" fi -install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL" +chmod 644 "${PI_HOLE_CONFIG_DIR}/dns-servers.conf" #================================================= -# INSTALL SUDOER FILE +# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE #================================================= -ynh_script_progression --message="Installing sudoer file..." --weight=1 +ynh_script_progression --message="Setting versions for the footer of the web interface..." --weight=1 -install -m 0640 ${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole.sudo /etc/sudoers.d/pihole -echo "$app ALL=NOPASSWD: ${PI_HOLE_BIN_DIR}/pihole" >> /etc/sudoers.d/pihole +echo "master master master" > "$PI_HOLE_CONFIG_DIR/localbranches" +echo "$(ynh_app_upstream_version) $pihole_adminlte_version $pihole_flt_version" \ + | tee "$PI_HOLE_CONFIG_DIR/"{GitHubVersions,localversions} > /dev/null #================================================= -# UPDATE A CRON JOB +# BUILD THE LISTS WITH GRAVITY #================================================= -ynh_script_progression --message="Updating a cron job..." --weight=1 +ynh_script_progression --message="Building the lists with Gravity..." --weight=7 -install -D -m 644 -T -o root -g root ${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole.cron /etc/cron.d/pihole - -# Randomize gravity update time -ynh_replace_string --match_string="59 1 " --replace_string="$((1 + RANDOM % 58)) $((3 + RANDOM % 2)) " --target_file="/etc/cron.d/pihole" - -# Randomize update checker time -ynh_replace_string --match_string="59 17" --replace_string="$((1 + RANDOM % 58)) $((12 + RANDOM % 8))" --target_file="/etc/cron.d/pihole" - -# Remove Git usage for version. Which fails because we use here a release instead of master. -ynh_replace_string --match_string=".*updatechecker.*" --replace_string="#&" --target_file=/etc/cron.d/pihole +ynh_add_config --template="adlists.default" --destination="$PI_HOLE_CONFIG_DIR/adlists.list" +ynh_exec_warn_less "$PI_HOLE_INSTALL_DIR/gravity.sh" --force #================================================= -# UPDATE LOGROTATE SCRIPT FOR PI-HOLE +# CONFIGURE DNS FOR THE LOCAL DOMAINS #================================================= -ynh_script_progression --message="Updating logrotate script for PI-HOLE..." --weight=1 +ynh_script_progression --message="Configuring DNS for the local domains..." --weight=7 -install -D -m 644 -T "${PI_HOLE_LOCAL_REPO}"/advanced/Templates/logrotate "$PI_HOLE_CONFIG_DIR/logrotate" +# List all YunoHost domains +while read -r perdomain; do + # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. + ynh_replace_string --match_string="^127.0.0.1.*$perdomain" --replace_string="#Commented by pihole# &" --target_file=/etc/hosts -sed -i "/# su #/d;" "$PI_HOLE_CONFIG_DIR/logrotate" + # And add a resolution on the local IP instead + grep -q "^$localipv4.*$perdomain" /etc/hosts || \ + echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts +done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')" #================================================= # DISABLING DNSMASQ #================================================= -ynh_script_progression --message="Disabling DNSMASQ..." --weight=1 +ynh_script_progression --message="Disabling Dnsmasq in system and yunohost..." --weight=1 -# Last version available -# Stopped dnsmasq to replace it by pihole-FTL +# Stop dnsmasq to replace it by pihole-FTL ynh_systemd_action --service_name=dnsmasq --action=stop # Disable the real dnsmasq service #ynh_exec_warn_less systemctl disable dnsmasq --quiet -#================================================= -# FINAL EXPORTS -#================================================= - -setupVars="$PI_HOLE_CONFIG_DIR/setupVars.conf" - -# Overwrite the setupVars config file only if it's allowed -if [ $overwrite_setupvars -eq 1 ] -then - ynh_script_progression --message="Final exports..." --weight=1 - - # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. - ynh_backup_if_checksum_is_different --file="$setupVars" - - # Get the default network interface - main_iface=$(ip route | grep --max-count=1 default | awk '{print $5;}') - echo "PIHOLE_INTERFACE=$main_iface" > $setupVars - echo "IPV4_ADDRESS=127.0.0.1" >> $setupVars - echo "IPV6_ADDRESS=::1" >> $setupVars - echo "PIHOLE_DNS_1=" >> $setupVars - echo "PIHOLE_DNS_2=" >> $setupVars - if [ $query_logging -eq 1 ]; then - query_logging=true - else - query_logging=false - fi - echo "QUERY_LOGGING=$query_logging" >> $setupVars - echo "INSTALL_WEB=true" >> $setupVars - echo "BLOCKING_ENABLED=true" >> $setupVars - - # Recalculate and store the checksum of the file for the next upgrade. - ynh_store_file_checksum --file="$setupVars" -fi - -#================================================= -# ENABLING FTL -#================================================= -ynh_script_progression --message="Enable FTL..." --weight=1 - -ynh_exec_warn_less systemctl enable pihole-FTL --quiet - # Replace the service dnsmasq by pihole-FTL # That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL #ln -sf /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/dnsmasq.service @@ -282,85 +175,41 @@ systemctl mask dnsmasq.service # Reload systemd config systemctl daemon-reload -#================================================= -# CREATE LOG FILES -#================================================= -ynh_script_progression --message="Creating log files..." --weight=1 - -touch /var/log/{pihole,pihole-FTL}.log -chmod 644 /var/log/{pihole,pihole-FTL}.log -dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2) -chown $dnsmasq_user:root /var/log/{pihole,pihole-FTL}.log - -#================================================= -# BUILD THE LISTS WITH GRAVITY -#================================================= -ynh_script_progression --message="Building the lists with Gravity..." --weight=7 - -cp -f "../conf/adlists.default" "$PI_HOLE_CONFIG_DIR/adlists.list" -ynh_exec_warn_less $PI_HOLE_INSTALL_DIR/gravity.sh --force - -#================================================= -# CONFIGURE DNS FOR THE LOCAL DOMAINS -#================================================= -ynh_script_progression --message="Configuring DNS for the local domains..." --weight=7 - -# Find the IP associated to the network interface -localipv4=$(ip address | grep "${main_iface}\$" | awk '{print $2;}' | cut -d/ -f1) - -# List all YunoHost domains -while read perdomain -do - # Comment domain resolution in /etc/hosts on 127.0.0.1, because they can interfere with the local network resolution. - ynh_replace_string --match_string="^127.0.0.1.*$perdomain" --replace_string="#Commented by pihole# &" --target_file=/etc/hosts - - # And add a resolution on the local IP instead - grep -q "^$localipv4.*$perdomain" /etc/hosts || \ - echo "$localipv4 $perdomain #Added by pihole#" >> /etc/hosts -done <<< "$(yunohost domain list | grep "\." | sed 's/.*: \|.*- //')" - -#================================================= -# SET VERSIONS FOR THE FOOTER OF THE WEB INTERFACE -#================================================= -ynh_script_progression --message="Setting versions for the footer of the web interface..." --weight=1 - -echo "master master master" > $PI_HOLE_CONFIG_DIR/localbranches -echo "$(ynh_app_upstream_version) $pihole_adminlte_version $pihole_flt_version" | tee $PI_HOLE_CONFIG_DIR/{GitHubVersions,localversions} > /dev/null - -#================================================= -# UPDATE CONF_REGEN HOOK -#================================================= -ynh_script_progression --message="Updating conf_regen hook..." --weight=1 - -cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" - -systemctl daemon-reload +# Workaround for strings to not be replaced +a_range="__A_RANGE__" +b_range="__B_RANGE__" +gateway="__GATEWAY__" +ynh_add_config --template="dnsmasq_regenconf_hook" --destination="/usr/share/yunohost/hooks/conf_regen/50-dnsmasq_$app" ynh_exec_warn_less yunohost tools regen-conf dnsmasq #================================================= -# GENERIC FINALIZATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +# Create a dedicated PHP-FPM config +ynh_add_fpm_config + +# Create a dedicated NGINX config +ynh_add_nginx_config + +_add_sudoers_config + +_add_cron_jobs + +_add_logrotate_config + +install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL" +ynh_exec_warn_less systemctl enable pihole-FTL --quiet yunohost service add pihole-FTL --description="PiHole backend service" --log="/var/log/pihole-FTL.log" --needs_exposed_ports 53 67 #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression --message="Starting $app's systemd service..." --weight=2 ynh_systemd_action --service_name=pihole-FTL --action=restart --log_path="/var/log/pihole-FTL.log" -#================================================= -# RELOAD NGINX -#================================================= -#REMOVEME? ynh_script_progression --message="Reloading NGINX web server..." --weight=1 - -#REMOVEME? ynh_systemd_action --service_name=nginx --action=reload - #================================================= # DEACTIVE MAINTENANCE MODE #=================================================