|
@@ -6,12 +6,12 @@
|
|
|
# IMPORT GENERIC HELPERS
|
|
# IMPORT GENERIC HELPERS
|
|
|
#=================================================
|
|
#=================================================
|
|
|
|
|
|
|
|
-source _common.sh
|
|
|
|
|
-source /usr/share/yunohost/helpers
|
|
|
|
|
-source _ynh_add_fpm_config
|
|
|
|
|
# Load common variables for all scripts.
|
|
# Load common variables for all scripts.
|
|
|
source _variables
|
|
source _variables
|
|
|
|
|
|
|
|
|
|
+source _common.sh
|
|
|
|
|
+source /usr/share/yunohost/helpers
|
|
|
|
|
+
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# LOAD SETTINGS
|
|
# LOAD SETTINGS
|
|
|
#=================================================
|
|
#=================================================
|
|
@@ -26,6 +26,7 @@ query_logging=$(ynh_app_setting_get --app=$app --key=query_logging)
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|
|
enable_dhcp=$(ynh_app_setting_get --app=$app --key=enable_dhcp)
|
|
enable_dhcp=$(ynh_app_setting_get --app=$app --key=enable_dhcp)
|
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
port=$(ynh_app_setting_get --app=$app --key=port)
|
|
|
|
|
+pihole_version="$(ynh_app_setting_get --app=$app --key=pihole_version)"
|
|
|
|
|
|
|
|
overwrite_setupvars=$(ynh_app_setting_get --app=$app --key=overwrite_setupvars)
|
|
overwrite_setupvars=$(ynh_app_setting_get --app=$app --key=overwrite_setupvars)
|
|
|
overwrite_ftl=$(ynh_app_setting_get --app=$app --key=overwrite_ftl)
|
|
overwrite_ftl=$(ynh_app_setting_get --app=$app --key=overwrite_ftl)
|
|
@@ -48,38 +49,50 @@ ynh_script_progression --message="Ensuring downward compatibility..."
|
|
|
|
|
|
|
|
# If overwrite_setupvars doesn't exist, create it
|
|
# If overwrite_setupvars doesn't exist, create it
|
|
|
if [ -z "$overwrite_setupvars" ]; then
|
|
if [ -z "$overwrite_setupvars" ]; then
|
|
|
- overwrite_setupvars=1
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=overwrite_setupvars --value=$overwrite_setupvars
|
|
|
|
|
|
|
+ overwrite_setupvars=1
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=overwrite_setupvars --value=$overwrite_setupvars
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# If overwrite_ftl doesn't exist, create it
|
|
# If overwrite_ftl doesn't exist, create it
|
|
|
if [ -z "$overwrite_ftl" ]; then
|
|
if [ -z "$overwrite_ftl" ]; then
|
|
|
- overwrite_ftl=1
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=overwrite_ftl --value=$overwrite_ftl
|
|
|
|
|
|
|
+ overwrite_ftl=1
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=overwrite_ftl --value=$overwrite_ftl
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# If overwrite_nginx doesn't exist, create it
|
|
# If overwrite_nginx doesn't exist, create it
|
|
|
if [ -z "$overwrite_nginx" ]; then
|
|
if [ -z "$overwrite_nginx" ]; then
|
|
|
- overwrite_nginx=1
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx
|
|
|
|
|
|
|
+ overwrite_nginx=1
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=overwrite_nginx --value=$overwrite_nginx
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# If overwrite_phpfpm doesn't exist, create it
|
|
# If overwrite_phpfpm doesn't exist, create it
|
|
|
if [ -z "$overwrite_phpfpm" ]; then
|
|
if [ -z "$overwrite_phpfpm" ]; then
|
|
|
- overwrite_phpfpm=1
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=$overwrite_phpfpm
|
|
|
|
|
|
|
+ overwrite_phpfpm=1
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=overwrite_phpfpm --value=$overwrite_phpfpm
|
|
|
|
|
+fi
|
|
|
|
|
+
|
|
|
|
|
+# If admin_mail_html doesn't exist, create it
|
|
|
|
|
+if [ -z "$admin_mail_html" ]; then
|
|
|
|
|
+ admin_mail_html=1
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# If fpm_footprint doesn't exist, create it
|
|
# If fpm_footprint doesn't exist, create it
|
|
|
if [ -z "$fpm_footprint" ]; then
|
|
if [ -z "$fpm_footprint" ]; then
|
|
|
- fpm_footprint=low
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
|
|
|
|
|
|
+ fpm_footprint=low
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# If fpm_usage doesn't exist, create it
|
|
# If fpm_usage doesn't exist, create it
|
|
|
if [ -z "$fpm_usage" ]; then
|
|
if [ -z "$fpm_usage" ]; then
|
|
|
- fpm_usage=low
|
|
|
|
|
- ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
|
|
|
|
|
|
+ fpm_usage=low
|
|
|
|
|
+ ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
|
|
|
|
+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
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
@@ -90,8 +103,8 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
|
|
|
# Backup the current version of the app
|
|
# Backup the current version of the app
|
|
|
ynh_backup_before_upgrade
|
|
ynh_backup_before_upgrade
|
|
|
ynh_clean_setup () {
|
|
ynh_clean_setup () {
|
|
|
- # restore it if the upgrade fails
|
|
|
|
|
- ynh_restore_upgradebackup
|
|
|
|
|
|
|
+ # restore it if the upgrade fails
|
|
|
|
|
+ ynh_restore_upgradebackup
|
|
|
}
|
|
}
|
|
|
# Exit if an error occurs during the execution of the script
|
|
# Exit if an error occurs during the execution of the script
|
|
|
ynh_abort_if_errors
|
|
ynh_abort_if_errors
|
|
@@ -126,11 +139,19 @@ ynh_install_app_dependencies $app_depencencies
|
|
|
pihole_local_repo="/etc/.pihole"
|
|
pihole_local_repo="/etc/.pihole"
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
then
|
|
then
|
|
|
- ynh_script_progression --message="Upgrading source files..." --weight=4
|
|
|
|
|
- # Update the local copy pihole repository (for Gravity)
|
|
|
|
|
- ynh_setup_source --dest_dir="$pihole_local_repo"
|
|
|
|
|
- # Update admin dashboard
|
|
|
|
|
- ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard
|
|
|
|
|
|
|
+ ynh_script_progression --message="Upgrading source files..." --weight=4
|
|
|
|
|
+ if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+ then
|
|
|
|
|
+ # Update the version 3.X
|
|
|
|
|
+ ynh_setup_source --dest_dir="$pihole_local_repo" --source_id=app_3
|
|
|
|
|
+ # Update admin dashboard
|
|
|
|
|
+ ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_3
|
|
|
|
|
+ else
|
|
|
|
|
+ # Update the last version available
|
|
|
|
|
+ ynh_setup_source --dest_dir="$pihole_local_repo" --source_id=app_last
|
|
|
|
|
+ # Update admin dashboard
|
|
|
|
|
+ ynh_setup_source --dest_dir="$final_path" --source_id=admin_dashboard_last
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
@@ -140,9 +161,9 @@ fi
|
|
|
# Overwrite the nginx configuration only if it's allowed
|
|
# Overwrite the nginx configuration only if it's allowed
|
|
|
if [ $overwrite_nginx -eq 1 ]
|
|
if [ $overwrite_nginx -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
|
|
|
|
|
- # Create a dedicated nginx config
|
|
|
|
|
- ynh_add_nginx_config
|
|
|
|
|
|
|
+ ynh_script_progression --message="Upgrading nginx web server configuration..." --weight=2
|
|
|
|
|
+ # Create a dedicated nginx config
|
|
|
|
|
+ ynh_add_nginx_config
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
@@ -160,9 +181,9 @@ ynh_system_user_create --username=$app
|
|
|
# Overwrite the php-fpm configuration only if it's allowed
|
|
# Overwrite the php-fpm configuration only if it's allowed
|
|
|
if [ $overwrite_phpfpm -eq 1 ]
|
|
if [ $overwrite_phpfpm -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=3
|
|
|
|
|
- # Create a dedicated php-fpm config
|
|
|
|
|
- ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
|
|
|
|
|
|
+ ynh_script_progression --message="Upgrading php-fpm configuration..." --weight=3
|
|
|
|
|
+ # Create a dedicated php-fpm config
|
|
|
|
|
+ ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --dedicated_service
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
@@ -191,7 +212,12 @@ cp -a "$pihole_local_repo/advanced/bash-completion/pihole" /etc/bash_completion.
|
|
|
#=================================================
|
|
#=================================================
|
|
|
|
|
|
|
|
# This sudoers config allow pihole to execute /usr/local/bin/pihole as root without password. Nothing more.
|
|
# This sudoers config allow pihole to execute /usr/local/bin/pihole as root without password. Nothing more.
|
|
|
-cp "$pihole_local_repo/advanced/pihole.sudo" /etc/sudoers.d/pihole
|
|
|
|
|
|
|
+if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+then
|
|
|
|
|
+ cp "$pihole_local_repo/advanced/pihole.sudo" /etc/sudoers.d/pihole
|
|
|
|
|
+else
|
|
|
|
|
+ cp "$pihole_local_repo/advanced/Templates/pihole.sudo" /etc/sudoers.d/pihole
|
|
|
|
|
+fi
|
|
|
echo "$app ALL=NOPASSWD: /usr/local/bin/pihole" >> /etc/sudoers.d/pihole
|
|
echo "$app ALL=NOPASSWD: /usr/local/bin/pihole" >> /etc/sudoers.d/pihole
|
|
|
chmod 0440 /etc/sudoers.d/pihole
|
|
chmod 0440 /etc/sudoers.d/pihole
|
|
|
|
|
|
|
@@ -200,7 +226,12 @@ chmod 0440 /etc/sudoers.d/pihole
|
|
|
#=================================================
|
|
#=================================================
|
|
|
|
|
|
|
|
pihole_storage="/etc/pihole"
|
|
pihole_storage="/etc/pihole"
|
|
|
-cp "$pihole_local_repo/advanced/logrotate" "$pihole_storage/logrotate"
|
|
|
|
|
|
|
+if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+then
|
|
|
|
|
+ cp "$pihole_local_repo/advanced/logrotate" "$pihole_storage/logrotate"
|
|
|
|
|
+else
|
|
|
|
|
+ cp "$pihole_local_repo/advanced/Templates/logrotate" "$pihole_storage/logrotate"
|
|
|
|
|
+fi
|
|
|
dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2)
|
|
dnsmasq_user=$(grep DNSMASQ_USER= /etc/init.d/dnsmasq | cut -d'"' -f2)
|
|
|
sed -i "/# su #/d;" "$pihole_storage/logrotate"
|
|
sed -i "/# su #/d;" "$pihole_storage/logrotate"
|
|
|
|
|
|
|
@@ -213,30 +244,70 @@ ynh_systemd_action --action=stop --service_name=pihole-FTL
|
|
|
|
|
|
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
if [ "$upgrade_type" == "UPGRADE_APP" ]
|
|
|
then
|
|
then
|
|
|
- # Get the source of Pi-Hole-FTL
|
|
|
|
|
- FTL_temp_path=$(mktemp -d)
|
|
|
|
|
- ynh_setup_source --dest_dir="$FTL_temp_path" --source_id=FTL
|
|
|
|
|
-
|
|
|
|
|
- # Instead of downloading a binary file, we're going to compile it
|
|
|
|
|
- ( cd "$FTL_temp_path"
|
|
|
|
|
- ynh_exec_warn_less make
|
|
|
|
|
- ynh_exec_warn_less make install )
|
|
|
|
|
- ynh_secure_remove --file="$FTL_temp_path"
|
|
|
|
|
|
|
+ # Get the source of Pi-Hole-FTL
|
|
|
|
|
+ FTL_temp_path=$(mktemp -d)
|
|
|
|
|
+ if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+ then
|
|
|
|
|
+ # Install the version 3.3.1
|
|
|
|
|
+ ynh_setup_source --dest_dir="$FTL_temp_path" --source_id=FTL_3
|
|
|
|
|
+ else
|
|
|
|
|
+ # Install the last version available
|
|
|
|
|
+ ynh_setup_source --dest_dir="$FTL_temp_path" --source_id=FTL_last
|
|
|
|
|
+ fi
|
|
|
|
|
+
|
|
|
|
|
+ # Instead of downloading a binary file, we're going to compile it
|
|
|
|
|
+ ( cd "$FTL_temp_path"
|
|
|
|
|
+ ynh_exec_warn_less make
|
|
|
|
|
+ ynh_exec_warn_less make install )
|
|
|
|
|
+ ynh_secure_remove --file="$FTL_temp_path"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Overwrite pihole-FTL config file only if it's allowed
|
|
# Overwrite pihole-FTL config file only if it's allowed
|
|
|
if [ $overwrite_ftl -eq 1 ]
|
|
if [ $overwrite_ftl -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
|
|
|
|
- ynh_backup_if_checksum_is_different --file="$pihole_storage/pihole-FTL.conf"
|
|
|
|
|
- cp "../conf/pihole-FTL.conf" "$pihole_storage"
|
|
|
|
|
- # Recalculate and store the checksum of the file for the next upgrade.
|
|
|
|
|
- ynh_store_file_checksum --file="$pihole_storage/pihole-FTL.conf"
|
|
|
|
|
|
|
+ # Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script.
|
|
|
|
|
+ ynh_backup_if_checksum_is_different --file="$pihole_storage/pihole-FTL.conf"
|
|
|
|
|
+ cp "../conf/pihole-FTL.conf" "$pihole_storage"
|
|
|
|
|
+ # Recalculate and store the checksum of the file for the next upgrade.
|
|
|
|
|
+ ynh_store_file_checksum --file="$pihole_storage/pihole-FTL.conf"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
-cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
|
|
|
|
|
-chmod +x /etc/init.d/pihole-FTL
|
|
|
|
|
-ynh_exec_warn_less systemctl enable pihole-FTL
|
|
|
|
|
|
|
+if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+then
|
|
|
|
|
+ # Version 3.3.1
|
|
|
|
|
+ cp -a $pihole_local_repo/advanced/pihole-FTL.service /etc/init.d/pihole-FTL
|
|
|
|
|
+ chmod +x /etc/init.d/pihole-FTL
|
|
|
|
|
+ ynh_exec_warn_less systemctl enable pihole-FTL
|
|
|
|
|
+else
|
|
|
|
|
+ # Last version available
|
|
|
|
|
+ # Stopped dnsmasq to replace it by pihole-FTL
|
|
|
|
|
+ ynh_systemd_action --action=stop --service_name=dnsmasq
|
|
|
|
|
+
|
|
|
|
|
+ # Disable the real dnsmasq service
|
|
|
|
|
+ ynh_exec_warn_less systemctl disable dnsmasq
|
|
|
|
|
+
|
|
|
|
|
+ # And move the files that make the service available in systemd to really disable it
|
|
|
|
|
+ mv /lib/systemd/system/dnsmasq.service /lib/systemd/system/.dnsmasq.service.backup_by_pihole
|
|
|
|
|
+ mv /etc/init.d/dnsmasq /etc/init.d/.dnsmasq.backup_by_pihole
|
|
|
|
|
+
|
|
|
|
|
+ # Move dnsmasq to preserve the current binary
|
|
|
|
|
+ mv /usr/sbin/dnsmasq /usr/sbin/dnsmasq.backup_by_pihole
|
|
|
|
|
+ # Replace dnsmasq by pihole-FTL
|
|
|
|
|
+ # NOTE: pihole-FTL is actually a modified version of dnsmasq
|
|
|
|
|
+ # https://github.com/pi-hole/FTL/tree/master/dnsmasq
|
|
|
|
|
+ ln -s /usr/bin/pihole-FTL /usr/sbin/dnsmasq
|
|
|
|
|
+
|
|
|
|
|
+ cp -a $pihole_local_repo/advanced/Templates/pihole-FTL.service /etc/init.d/pihole-FTL
|
|
|
|
|
+ chmod +x /etc/init.d/pihole-FTL
|
|
|
|
|
+ ynh_exec_warn_less systemctl enable pihole-FTL
|
|
|
|
|
+
|
|
|
|
|
+ # Replace the service dnsmasq by pihole-FTL
|
|
|
|
|
+ # That way, YunoHost can continue to use dnsmasq by actually using pihole-FTL
|
|
|
|
|
+ ln -s /run/systemd/generator.late/pihole-FTL.service /etc/systemd/system/multi-user.target.wants/dnsmasq.service
|
|
|
|
|
+
|
|
|
|
|
+ # Reload systemd config
|
|
|
|
|
+ systemctl daemon-reload
|
|
|
|
|
+fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# BUILD VARIABLES FILE
|
|
# BUILD VARIABLES FILE
|
|
@@ -247,33 +318,38 @@ setupVars="$pihole_storage/setupVars.conf"
|
|
|
# Overwrite the setupVars config file only if it's allowed
|
|
# Overwrite the setupVars config file only if it's allowed
|
|
|
if [ $overwrite_setupvars -eq 1 ]
|
|
if [ $overwrite_setupvars -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- # 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
|
|
|
|
|
-
|
|
|
|
|
- # Recalculate and store the checksum of the file for the next upgrade.
|
|
|
|
|
- ynh_store_file_checksum --file="$setupVars"
|
|
|
|
|
|
|
+ # 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
|
|
|
|
|
+
|
|
|
|
|
+ # Recalculate and store the checksum of the file for the next upgrade.
|
|
|
|
|
+ ynh_store_file_checksum --file="$setupVars"
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
#=================================================
|
|
#=================================================
|
|
|
# UPDATE CRON JOB
|
|
# UPDATE CRON JOB
|
|
|
#=================================================
|
|
#=================================================
|
|
|
|
|
|
|
|
-cp $pihole_local_repo/advanced/pihole.cron /etc/cron.d/pihole
|
|
|
|
|
|
|
+if [ "$pihole_version" == "Last 3.X" ]
|
|
|
|
|
+then
|
|
|
|
|
+ cp $pihole_local_repo/advanced/pihole.cron /etc/cron.d/pihole
|
|
|
|
|
+else
|
|
|
|
|
+ cp $pihole_local_repo/advanced/Templates/pihole.cron /etc/cron.d/pihole
|
|
|
|
|
+fi
|
|
|
# Remove git usage for version. Which fails because we use here a release instead of master.
|
|
# 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_replace_string --match_string=".*updatechecker.*" --replace_string="#&" --target_file=/etc/cron.d/pihole
|
|
|
|
|
|
|
@@ -311,10 +387,6 @@ ynh_maintenance_mode_OFF
|
|
|
# Get main domain and buid the url of the admin panel of the app.
|
|
# Get main domain and buid the url of the admin panel of the app.
|
|
|
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
|
|
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
|
|
|
|
|
|
|
|
-# Build the changelog
|
|
|
|
|
-# Get the value of admin_mail_html
|
|
|
|
|
-admin_mail_html=$(ynh_app_setting_get $app admin_mail_html)
|
|
|
|
|
-admin_mail_html="${admin_mail_html:-0}"
|
|
|
|
|
# If a html email is required. Apply html to the changelog.
|
|
# If a html email is required. Apply html to the changelog.
|
|
|
if [ "$admin_mail_html" -eq 1 ]; then
|
|
if [ "$admin_mail_html" -eq 1 ]; then
|
|
|
format=html
|
|
format=html
|
|
@@ -325,12 +397,12 @@ ynh_app_changelog --format=$format
|
|
|
|
|
|
|
|
if [ $enable_dhcp -eq 1 ]
|
|
if [ $enable_dhcp -eq 1 ]
|
|
|
then
|
|
then
|
|
|
- dhcp_alert="You asked to use the internal DHCP server of dnsmasq with PiHole.
|
|
|
|
|
|
|
+ dhcp_alert="You asked to use the internal DHCP server of dnsmasq with PiHole.
|
|
|
You should really read the documentation about that, https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md
|
|
You should really read the documentation about that, https://github.com/YunoHost-Apps/pihole_ynh/blob/master/dhcp.md
|
|
|
|
|
|
|
|
"
|
|
"
|
|
|
else
|
|
else
|
|
|
- dhcp_alert=""
|
|
|
|
|
|
|
+ dhcp_alert=""
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
echo "${dhcp_alert}You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
|
|
echo "${dhcp_alert}You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
|