1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cockpit_ynh.git synced 2024-09-03 18:16:26 +02:00
cockpit_ynh/scripts/change_url

55 lines
1.9 KiB
Text
Raw Normal View History

2022-03-13 21:51:45 +01:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Stopping a systemd service..." --weight=1
2022-03-13 21:51:45 +01:00
ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd"
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
2022-03-13 21:51:45 +01:00
2023-08-12 10:35:10 +02:00
ynh_change_url_nginx_config
2022-03-13 21:51:45 +01:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# UPDATE A CONFIG FILE
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Updating a configuration file..." --weight=1
2022-03-13 21:51:45 +01:00
ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf"
2023-08-12 10:41:47 +02:00
chmod 650 "/etc/cockpit/cockpit.conf"
2022-09-23 02:05:16 +02:00
chown root:$app-ws "/etc/cockpit/cockpit.conf"
2022-03-13 21:51:45 +01:00
#=================================================
# GENERIC FINALISATION
#=================================================
# START SYSTEMD SERVICE
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Starting a systemd service..." --weight=1
2022-03-13 21:51:45 +01:00
# Start a systemd service
ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Started"
#=================================================
# END OF SCRIPT
#=================================================
2022-09-03 00:44:25 +02:00
ynh_script_progression --message="Change of URL completed for $app" --last