[autopatch] Automatic patch attempt for helpers 2.1

This commit is contained in:
Yunohost-Bot
2024-08-30 22:57:28 +02:00
committed by Josué Tille
parent 9e748220af
commit a9647ffbf1
8 changed files with 116 additions and 144 deletions

View File

@ -1,51 +1,41 @@
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Stopping a systemd service..." --weight=1
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemd_action --service_name="$app" --action=stop
ynh_systemctl --service="$app" --action=stop
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
ynh_script_progression "Updating NGINX web server configuration..."
ynh_change_url_nginx_config
ynh_config_change_url_nginx
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# Setup gitea.ini
#=================================================
ynh_script_progression --message="Updating gitea configuration..."
ynh_script_progression "Updating gitea configuration..."
ynh_add_config --template="app.ini" --destination="$install_dir/custom/conf/app.ini"
ynh_config_add --template="app.ini" --destination="$install_dir/custom/conf/app.ini"
_set_permissions
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting gitea services..." --weight=3
ynh_script_progression "Starting gitea services..."
ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line"
ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Change of URL completed for $app" --last
ynh_script_progression "Change of URL completed for $app"