mirror of
https://github.com/YunoHost-Apps/lufi_ynh.git
synced 2024-09-03 19:36:28 +02:00
68 lines
2.1 KiB
Bash
68 lines
2.1 KiB
Bash
#!/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..."
|
|
|
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="$install_dir/log/production.log"
|
|
|
|
if [ -f "$install_dir/script/hypnotoad.pid" ]; then
|
|
ynh_print_info --message="Removing the PID file..."
|
|
ynh_secure_remove --file="$install_dir/script/hypnotoad.pid"
|
|
fi
|
|
|
|
#=================================================
|
|
# MODIFY URL IN NGINX CONF
|
|
#=================================================
|
|
ynh_script_progression --message="Updating NGINX web server configuration..."
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
#=================================================
|
|
# SPECIFIC MODIFICATIONS
|
|
#=================================================
|
|
# CONFIGURE LUFI
|
|
#=================================================
|
|
ynh_script_progression --message="Configuring lufi..."
|
|
|
|
domain="$new_domain"
|
|
path="$new_path"
|
|
|
|
ldap="#"
|
|
if [ $use_ldap -eq 1 ];
|
|
then
|
|
ldap=""
|
|
fi
|
|
|
|
ynh_add_config --template="../conf/lufi.conf" --destination="$install_dir/lufi.conf"
|
|
|
|
chmod 600 $install_dir/lufi.conf
|
|
chown $app:$app $install_dir/lufi.conf
|
|
|
|
#=================================================
|
|
# GENERIC FINALISATION
|
|
#=================================================
|
|
# START SYSTEMD SERVICE
|
|
#=================================================
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
# Start a systemd service
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="$install_dir/log/production.log" --line_match="Creating process id file"
|
|
|
|
#=================================================
|
|
# END OF SCRIPT
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app"
|