From 79c631ffa3f516130e47367591e0606db790e389 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sat, 30 Dec 2023 02:54:19 +0100 Subject: [PATCH] fix shellcheck SC2086 --- scripts/change_url | 8 ++++---- scripts/remove | 4 ++-- scripts/restore | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index fb0e118..91a4e9e 100644 --- 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="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -32,8 +32,8 @@ ynh_script_progression --message="Modifying a config file..." --weight=1 ynh_add_config --template="../conf/config.yml" --destination="$install_dir/config/config.yml" -chmod 600 $install_dir/config/config.yml -chown $app:$app "$install_dir/config/config.yml" +chmod 600 "$install_dir/config/config.yml" +chown "$app:$app" "$install_dir/config/config.yml" #================================================= # GENERIC FINALISATION @@ -42,7 +42,7 @@ chown $app:$app "$install_dir/config/config.yml" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 95cc5e2..ca7f10d 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers #================================================= # 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..." --weight=1 - yunohost service remove $app + yunohost service remove "$app" fi #================================================= diff --git a/scripts/restore b/scripts/restore index c970c8c..5fbbb2a 100644 --- a/scripts/restore +++ b/scripts/restore @@ -26,7 +26,7 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # SPECIFIC RESTORATION @@ -42,7 +42,7 @@ ynh_exec_warn_less curl -fsSL https://crystal-lang.org/install.sh | bash -s -- - #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 -ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name +ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" #================================================= # RESTORE SYSTEM CONFIGURATIONS @@ -50,7 +50,7 @@ ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet ynh_restore_file --origin_path="/etc/cron.d/$app" chown root: "/etc/cron.d/$app" @@ -58,7 +58,7 @@ chmod 644 "/etc/cron.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app" -yunohost service add $app --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Invidious is an alternative front-end to YouTube" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -67,7 +67,7 @@ yunohost service add $app --description="Invidious is an alternative front-end t #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action=start --log_path=systemd +ynh_systemd_action --service_name="$app" --action=start --log_path=systemd ynh_systemd_action --service_name=nginx --action=reload