jwe_ynh 2.0.0~ynh1 — paquet YunoHost initial (format v2, helpers 2.1)
This commit is contained in:
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression "Restoring the app main directory..."
|
||||
|
||||
ynh_restore "$install_dir"
|
||||
|
||||
chown -R "$app:$app" "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEM CONFIGURATION
|
||||
#=================================================
|
||||
ynh_script_progression "Restoring system configurations related to $app..."
|
||||
|
||||
ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
|
||||
ynh_restore "/etc/systemd/system/$app.service"
|
||||
systemctl enable "$app.service" --quiet
|
||||
|
||||
yunohost service add "$app" --description="Jeu de géolocalisation OKI" --log="/var/log/$app/$app.log"
|
||||
|
||||
mkdir -p "/var/log/$app"
|
||||
chown -R "$app:$app" "/var/log/$app"
|
||||
ynh_restore "/etc/logrotate.d/$app"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX AND START THE APP SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression "Reloading NGINX web server and $app's service..."
|
||||
|
||||
ynh_systemctl --service="$app" --action="start" --wait_until="Listening" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
ynh_systemctl --service=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression "Restoration completed for $app"
|
||||
Reference in New Issue
Block a user