1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pihole_ynh.git synced 2024-09-03 20:05:58 +02:00

Update to last standard

This commit is contained in:
maniack 2019-12-09 18:09:43 +01:00
parent 65d1ba63fc
commit 9294176a2d
5 changed files with 16 additions and 10 deletions

View file

@ -16,7 +16,6 @@
upgrade=1 from_commit=d79ec131b3038ff4695c3317b5d3ee4eda9c8932
backup_restore=1
multi_instance=0
incorrect_path=1
port_already_use=1 (4711)
change_url=1
;;; Levels

View file

@ -30,14 +30,21 @@ ynh_script_progression --message="Load settings" --weight=2
final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# CHECK THE SYNTAX OF THE PATHS
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Check the syntax of the paths"
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=11
test -n "$old_path" || old_path="/"
test -n "$new_path" || new_path="/"
new_path=$(ynh_normalize_url_path $new_path)
old_path=$(ynh_normalize_url_path $old_path)
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# ACTIVATE MAINTENANCE MODE

View file

@ -357,7 +357,7 @@ cp ../conf/dnsmasq_regenconf_hook /usr/share/yunohost/hooks/conf_regen/50-dnsmas
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add pihole-FTL --log "/var/log/pihole-FTL.log"
yunohost service add pihole-FTL --description "PiHole backend service" --log "/var/log/pihole-FTL.log"
#=================================================
# RESTRAIN THE ACCESS TO THE ADMIN ONLY

View file

@ -26,7 +26,7 @@ port=$(ynh_app_setting_get $app port)
#=================================================
# Check if the service is declared in YunoHost
if yunohost service status | grep -q pihole-FTL
if ynh_exec_fully_quiet yunohost service status pihole-FTL
then
ynh_print_info "Remove pihole-FTL service" >&2
yunohost service remove pihole-FTL

View file

@ -102,7 +102,7 @@ ynh_install_app_dependencies $app_depencencies
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add pihole-FTL --log "/var/log/pihole-FTL.log"
yunohost service add pihole-FTL --description "PiHole backend service" --log "/var/log/pihole-FTL.log"
#=================================================
# RESTORE THE CRON FILE