Kay0u
5 years ago
No known key found for this signature in database
GPG Key ID: AAFEEB16CFA2AE2D
4 changed files with
24 additions and
2 deletions
-
scripts/backup
-
scripts/change_url
-
scripts/remove
-
scripts/restore
|
|
|
@ -26,6 +26,7 @@ app=$YNH_APP_INSTANCE_NAME |
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain) |
|
|
|
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) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
@ -86,6 +87,15 @@ ynh_print_info --message="Backing up data directory..." |
|
|
|
|
|
|
|
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 |
|
|
|
#================================================= |
|
|
|
|
|
|
|
@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." |
|
|
|
|
|
|
|
# Needed for helper "ynh_add_nginx_config" |
|
|
|
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) |
|
|
|
|
|
|
|
#================================================= |
|
|
|
@ -80,6 +81,14 @@ then |
|
|
|
# Set global variables for NGINX helper |
|
|
|
domain="$old_domain" |
|
|
|
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 |
|
|
|
ynh_add_nginx_config |
|
|
|
fi |
|
|
|
|
|
|
|
@ -85,6 +85,7 @@ ynh_remove_fail2ban_config |
|
|
|
ynh_script_progression --message="Stopping and removing the systemd service..." |
|
|
|
|
|
|
|
ynh_remove_systemd_config --service="${app}-notify-push" |
|
|
|
ynh_secure_remove --file="/var/run/$app/" |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# SPECIFIC REMOVE |
|
|
|
|
|
|
|
@ -27,6 +27,7 @@ domain=$(ynh_app_setting_get --app=$app --key=domain) |
|
|
|
path_url=$(ynh_app_setting_get --app=$app --key=path) |
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path) |
|
|
|
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) |
|
|
|
|
|
|
|
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" |
|
|
|
|
|
|
|
#================================================= |
|
|
|
# CONFIGURE NOTIFY_PUSH APP |
|
|
|
# RESTORE THE NOTIFY_PUSH APP |
|
|
|
#================================================= |
|
|
|
|
|
|
|
if [ $use_notify_push -eq 1 ] |
|
|
|
@ -137,8 +138,9 @@ then |
|
|
|
mkdir -p /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 |
|
|
|
fi |
|
|
|
|
|
|
|
|