1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hedgedoc_ynh.git synced 2024-09-03 19:25:52 +02:00
hedgedoc_ynh/scripts/change_url

49 lines
1.8 KiB
Text
Raw Normal View History

2020-11-19 21:41:03 +01:00
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
2020-11-19 21:41:03 +01:00
ynh_systemctl --service=$app --action=stop --log_path=systemd
2020-11-19 21:41:03 +01:00
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression "Updating NGINX web server configuration..."
2020-11-19 21:41:03 +01:00
ynh_config_change_url_nginx
2020-11-19 21:41:03 +01:00
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
2020-11-19 21:56:06 +01:00
# CONFIGURE HEDGEDOC
2020-11-19 21:41:03 +01:00
#=================================================
ynh_backup_if_checksum_is_different "$install_dir/config.json"
2020-11-19 21:41:03 +01:00
domain=$new_domain
url_path=${new_path#/}
2020-11-19 21:41:03 +01:00
ynh_config_add --template="config.json.example" --destination="$install_dir/config.json"
2020-11-19 21:41:03 +01:00
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/config.json"
#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/config.json"
2020-11-19 21:41:03 +01:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
2020-11-19 21:41:03 +01:00
# Start a systemd service
ynh_systemctl --service=$app --action=start --log_path=systemd --wait_until="HTTP Server listening"
2020-11-19 21:41:03 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Change of URL completed for $app"