Browse Source

fix notify_app

add-notify_push-option
Kay0u 5 years ago
parent
commit
335afb6902
No known key found for this signature in database GPG Key ID: AAFEEB16CFA2AE2D
  1. 10
      scripts/backup
  2. 9
      scripts/change_url
  3. 1
      scripts/remove
  4. 6
      scripts/restore

10
scripts/backup

@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
@ -86,6 +87,15 @@ ynh_print_info --message="Backing up data directory..."
ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big ynh_backup --src_path="/home/yunohost.app/${app}/data" --is_big
#=================================================
# BACKUP THE NOTIFY_PUSH APP
#=================================================
if [ $use_notify_push -eq 1 ]
then
ynh_backup --src_path="/etc/systemd/system/${app}-notify-push.service"
fi
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

9
scripts/change_url

@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..."
# Needed for helper "ynh_add_nginx_config" # Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
#================================================= #=================================================
@ -80,6 +81,14 @@ then
# Set global variables for NGINX helper # Set global variables for NGINX helper
domain="$old_domain" domain="$old_domain"
path_url="$new_path" path_url="$new_path"
if [ $use_notify_push -eq 1 ]
then
string_use_notify_push=""
else
string_use_notify_push="#"
fi
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
fi fi

1
scripts/remove

@ -85,6 +85,7 @@ ynh_remove_fail2ban_config
ynh_script_progression --message="Stopping and removing the systemd service..." ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config --service="${app}-notify-push" ynh_remove_systemd_config --service="${app}-notify-push"
ynh_secure_remove --file="/var/run/$app/"
#================================================= #=================================================
# SPECIFIC REMOVE # SPECIFIC REMOVE

6
scripts/restore

@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path) path_url=$(ynh_app_setting_get --app=$app --key=path)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
use_notify_push=$(ynh_app_setting_get --app=$app --key=use_notify_push)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
@ -129,7 +130,7 @@ ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p "$datadir" mkdir -p "$datadir"
#================================================= #=================================================
# CONFIGURE NOTIFY_PUSH APP
# RESTORE THE NOTIFY_PUSH APP
#================================================= #=================================================
if [ $use_notify_push -eq 1 ] if [ $use_notify_push -eq 1 ]
@ -137,8 +138,9 @@ then
mkdir -p /var/run/$app/ mkdir -p /var/run/$app/
chown $app: /var/run/$app/ chown $app: /var/run/$app/
ynh_add_systemd_config --service="${app}-notify-push"
ynh_restore_file --origin_path="/etc/systemd/system/${app}-notify-push.service"
systemctl enable $app.service --quiet
ynh_systemd_action --service_name="${app}-notify-push" --action=restart ynh_systemd_action --service_name="${app}-notify-push" --action=restart
fi fi

Loading…
Cancel
Save