1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pufferpanel_ynh.git synced 2024-09-03 20:16:03 +02:00

various fixes

This commit is contained in:
OniriCorpe 2024-01-22 05:29:46 +01:00
parent 1bc3c13261
commit bb1e26d129
5 changed files with 24 additions and 24 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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