1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ntfy_ynh.git synced 2024-09-03 19:46:27 +02:00

fix SC2086

This commit is contained in:
OniriCorpe 2024-01-16 20:28:41 +01:00
parent 0aff66e852
commit ee2e76b6c3
5 changed files with 18 additions and 18 deletions

View file

@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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 # MODIFY URL IN NGINX CONF
@ -39,7 +39,7 @@ ynh_add_systemd_config
#================================================= #=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=1 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 # END OF SCRIPT

View file

@ -21,7 +21,7 @@ ynh_setup_source --dest_dir="$install_dir"
mkdir -p "$install_dir/data" mkdir -p "$install_dir/data"
chmod -R 750 "$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/client"
ynh_secure_remove "$install_dir/server" ynh_secure_remove "$install_dir/server"
@ -44,7 +44,7 @@ ynh_add_nginx_config
ynh_add_systemd_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 # 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_script_progression --message="Adding a configuration file..." --weight=1
ynh_add_config -t "ntfy.sh" -d "$install_dir/ntfy.sh" 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" 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_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 # ADD ADMIN
#================================================= #=================================================
ynh_script_progression --message="Adding admin user..." --weight=1 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 # END OF SCRIPT

View file

@ -9,10 +9,10 @@ source /usr/share/yunohost/helpers
# REMOVE SYSTEMD SERVICE # REMOVE SYSTEMD SERVICE
#================================================= #=================================================
# Remove the service from the list of services known by YunoHost (added from `yunohost service add`) # 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 then
ynh_script_progression --message="Removing $app service integration..." --weight=1 ynh_script_progression --message="Removing $app service integration..." --weight=1
yunohost service remove $app yunohost service remove "$app"
fi fi
ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 ynh_script_progression --message="Removing system configurations related to $app..." --weight=1

View file

@ -17,7 +17,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight=
ynh_restore_file --origin_path="$install_dir" ynh_restore_file --origin_path="$install_dir"
chown -R $app:www-data "$install_dir" chown -R "$app:www-data" "$install_dir"
#================================================= #=================================================
# RESTORE SYSTEM CONFIGURATIONS # 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/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" 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 # 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_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 ynh_systemd_action --service_name=nginx --action=reload

View file

@ -16,7 +16,7 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1 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...) # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...)
@ -33,7 +33,7 @@ then
mkdir -p "$install_dir/data" mkdir -p "$install_dir/data"
chmod -R 750 "$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/client"
ynh_secure_remove "$install_dir/server" ynh_secure_remove "$install_dir/server"
@ -48,7 +48,7 @@ ynh_add_nginx_config
ynh_add_systemd_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...) # 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" 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" 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_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 # END OF SCRIPT