Apply example_ynh

This commit is contained in:
yalh76
2020-02-22 18:44:18 +01:00
parent d61aea9965
commit 0e19cc61e6
5 changed files with 18 additions and 4 deletions

View File

@@ -12,7 +12,8 @@ source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
#===ynh_print_info --message="Managing script failure..."
==============================================
ynh_clean_setup () {
ynh_clean_check_starting
@@ -51,6 +52,7 @@ test ! -d $final_path \
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_print_info --message="Restoring the nginx configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
@@ -72,6 +74,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
# RESTORE USER RIGHTS
#=================================================
ynh_print_info --message="Restoring user rights..."
# Restore permissions on app files
chown -R "$app":"$app" "$final_path"
@@ -84,7 +87,6 @@ chown -R "$app":"$app" "$final_path"
ynh_print_info --message="Reinstalling dependencies..."
# Define and install dependencies
ynh_install_nodejs --nodejs_version="10"
ynh_install_app_dependencies $pkg_dependencies
@@ -109,6 +111,7 @@ systemctl enable $app.service
#=================================================
# INTEGRATE SERVICE IN YUNOHOST
#=================================================
ynh_print_info --message="Integrating service in YunoHost..."
yunohost service add $app --description "$app daemon for Wiki.js" --log_type systemd