diff --git a/scripts/change_url b/scripts/change_url index 8c014a5..e84a828 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..." -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 @@ -33,7 +33,7 @@ ynh_change_url_nginx_config ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 461ae0a..3d7f9b1 100644 --- a/scripts/install +++ b/scripts/install @@ -13,14 +13,14 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -email=$(ynh_user_get_info --username=$admin --key=mail) +email=$(ynh_user_get_info --username="$admin" --key=mail) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= ynh_script_progression --message="Validating installation parameters..." -if [[ $admin < 5 ]]; then +if [[ $admin -lt 5 ]]; then ynh_die --message="Admin username minimum length is 5" fi @@ -30,7 +30,7 @@ fi chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # NGINX CONFIGURATION @@ -40,9 +40,9 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # SPECIFIC SETUP @@ -54,9 +54,9 @@ ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="config.json" --destination="/etc/$app/config.json" chmod 650 "/etc/$app/config.json" -chown $app:$app "/etc/$app/config.json" +chown "$app:$app" "/etc/$app/config.json" -pufferpanel user add --admin --email=$email --name=$admin --password=$password +pufferpanel user add --admin --email="$email" --name="$admin" --password="$password" #================================================= # GENERIC FINALIZATION @@ -66,7 +66,7 @@ pufferpanel user add --admin --email=$email --name=$admin --password=$password ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 23a0a4c..da0e4a3 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 integration..." - yunohost service remove $app + yunohost service remove "$app" fi # Remove the dedicated NGINX config diff --git a/scripts/restore b/scripts/restore index 39470e1..3f07df1 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,14 +19,14 @@ 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" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= 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 VARIOUS FILES @@ -38,9 +38,9 @@ ynh_restore_file --origin_path="/var/lib/$app/" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -49,7 +49,7 @@ yunohost service add $app --description="Web-based Game Server Management System #================================================= 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" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index 41f4066..66f3369 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -email=$(ynh_user_get_info --username=$admin --key=mail) +email=$(ynh_user_get_info --username="$admin" --key=mail) #================================================= # CHECK VERSION @@ -28,7 +28,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # UPGRADE DEPENDENCIES @@ -36,7 +36,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -46,9 +46,9 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config ynh_add_nginx_config -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # UPDATE A CONFIG FILE @@ -58,14 +58,14 @@ ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template="config.json" --destination="/etc/$app/config.json" chmod 650 "/etc/$app/config.json" -chown $app:$app "/etc/$app/config.json" +chown "$app:$app" "/etc/$app/config.json" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT