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

58 lines
1.7 KiB
Bash

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STOP SYSTEMD SERVICE
#=================================================
ynh_script_progression "Stopping $app's systemd service..."
ynh_systemctl --service=$app --action="stop" --log_path="$install_dir/log/production.log"
if [ -f "$install_dir/script/hypnotoad.pid" ]; then
ynh_print_info "Removing the PID file..."
ynh_safe_rm "$install_dir/script/hypnotoad.pid"
fi
#=================================================
# MODIFY URL IN NGINX CONF
#=================================================
ynh_script_progression "Updating NGINX web server configuration..."
ynh_config_change_url_nginx
#=================================================
# SPECIFIC MODIFICATIONS
#=================================================
# CONFIGURE LUFI
#=================================================
ynh_script_progression "Configuring lufi..."
domain="$new_domain"
path="$new_path"
ldap="#"
if [ $use_ldap -eq 1 ];
then
ldap=""
fi
ynh_config_add --template="lufi.conf" --destination="$install_dir/lufi.conf"
chmod 600 $install_dir/lufi.conf
chown $app:$app $install_dir/lufi.conf
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression "Starting $app's systemd service..."
# Start a systemd service
ynh_systemctl --service=$app --action="start" --log_path="$install_dir/log/production.log" --wait_until="Creating process id file"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Change of URL completed for $app"