diff --git a/scripts/change_url b/scripts/change_url index 572b377..6084121 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # MODIFY URL IN NGINX CONF @@ -39,7 +39,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 1041919..4aaba2e 100755 --- a/scripts/install +++ b/scripts/install @@ -21,7 +21,7 @@ ynh_setup_source --dest_dir="$install_dir" mkdir -p "$install_dir/data" chmod -R 750 "$install_dir/data" -chown -R $app:$app "$install_dir" +chown -R "$app:$app" "$install_dir" ynh_secure_remove "$install_dir/client" ynh_secure_remove "$install_dir/server" @@ -44,7 +44,7 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" #================================================= # ADD A CONFIGURATION @@ -52,7 +52,7 @@ yunohost service add $app --description="Open Source Push Notification Server" - ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config -t "ntfy.sh" -d "$install_dir/ntfy.sh" -chown $app:$app "$install_dir/ntfy.sh" +chown "$app:$app" "$install_dir/ntfy.sh" chmod u+x "$install_dir/ntfy.sh" #================================================= @@ -62,14 +62,14 @@ chmod u+x "$install_dir/ntfy.sh" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" #================================================= # ADD ADMIN #================================================= ynh_script_progression --message="Adding admin user..." --weight=1 -ynh_exec_as $app NTFY_PASSWORD="$password" $install_dir/ntfy.sh user add --role=admin $admin +ynh_exec_as "$app" NTFY_PASSWORD="$password" "$install_dir/ntfy.sh" user add --role=admin "$admin" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 6dc0d3b..3e175cb 100755 --- a/scripts/remove +++ b/scripts/remove @@ -9,10 +9,10 @@ source /usr/share/yunohost/helpers # REMOVE SYSTEMD SERVICE #================================================= # 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 +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 + yunohost service remove "$app" fi ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 diff --git a/scripts/restore b/scripts/restore index 1566077..695c64d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -17,7 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -29,9 +29,9 @@ ynh_script_progression --message="Restoring system configurations related to $ap ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -40,7 +40,7 @@ yunohost service add $app --description="Open Source Push Notification Server" - #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index aa1b779..d8dc85b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$app/$app.log" #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) @@ -33,7 +33,7 @@ then mkdir -p "$install_dir/data" chmod -R 750 "$install_dir/data" - chown -R $app:$app "$install_dir" + chown -R "$app:$app" "$install_dir" ynh_secure_remove "$install_dir/client" ynh_secure_remove "$install_dir/server" @@ -48,7 +48,7 @@ ynh_add_nginx_config ynh_add_systemd_config -yunohost service add $app --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Open Source Push Notification Server" --log="/var/log/$app/$app.log" #================================================= # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) @@ -66,7 +66,7 @@ ynh_script_progression --message="Updating simple command wrapper..." --weight=1 ynh_add_config --template="ntfy.sh" --destination="$install_dir/ntfy.sh" -chown $app:$app "$install_dir/ntfy.sh" +chown "$app:$app" "$install_dir/ntfy.sh" chmod u+x "$install_dir/ntfy.sh" #================================================= @@ -74,7 +74,7 @@ chmod u+x "$install_dir/ntfy.sh" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app" --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT