diff --git a/scripts/install b/scripts/install index ffe0af0..6670b83 100755 --- a/scripts/install +++ b/scripts/install @@ -58,15 +58,6 @@ chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:$app "$install_dir" -#================================================= -# CREATE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Creating a data directory..." - -chmod 750 "$data_dir" -chmod -R o-rwx "$data_dir" -chown -R $app:www-data "$data_dir" - #================================================= # ADD A CONFIGURATION #================================================= diff --git a/scripts/remove b/scripts/remove index df15061..6ee1c34 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,43 +9,49 @@ source _common.sh source /usr/share/yunohost/helpers -# Settings are automatically loaded as bash variables -# in every app script context, therefore typically these will exist: -# - $domain -# - $path -# - $language -# - $install_dir -# - $port -# ... - -# For remove operations : -# - the core will deprovision every resource defined in the manifest **after** this script is ran -# this includes removing the install directory, and data directory (if --purge was used) - #================================================= -# REMOVE SYSTEM CONFIGURATIONS +# STOP AND REMOVE SERVICE #================================================= -# REMOVE SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 - -# This should be a symetric version of what happens in the install script - -# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app -fi +ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 +# Remove the dedicated systemd config ynh_remove_systemd_config -ynh_remove_nginx_config +#================================================= +# REMOVE LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Removing logrotate configuration..." --weight=1 +# Remove the app-specific logrotate config ynh_remove_logrotate +#================================================= +# REMOVE NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 + +# Remove the dedicated NGINX config +ynh_remove_nginx_config + +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=4 + +# Remove metapackage and its dependencies +ynh_remove_nodejs + +#================================================= +# SPECIFIC REMOVE +#================================================= +# REMOVE VARIOUS FILES +#================================================= +ynh_script_progression --message="Removing various files..." --weight=1 + +# Remove the log files ynh_secure_remove --file="/var/log/$app" + #================================================= # END OF SCRIPT #=================================================