2023-05-26 17:16:13 +02:00
|
|
|
#!/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_systemd_action --service_name=$app --action="stop" --line_match="Stopped" --log_path=systemd
|
|
|
|
ynh_systemd_action --service_name=$app-ui --action="stop" --line_match="Stopped" --log_path=systemd
|
2023-07-12 10:50:21 +02:00
|
|
|
ynh_systemd_action --service_name=$app-pict-rs --action="stop" --line_match="Stopped" --log_path=systemd
|
2023-05-26 17:16:13 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# MODIFY URL IN NGINX CONF
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1
|
|
|
|
|
|
|
|
ynh_change_url_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
|
|
|
|
mkdir -p "$install_dir/config/"
|
|
|
|
ynh_add_config --template="../conf/lemmy.hjson" --destination="$install_dir/config/config.hjson"
|
|
|
|
|
|
|
|
chmod 400 "$install_dir/config/config.hjson"
|
|
|
|
chown $app:$app "$install_dir/config/config.hjson"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALISATION
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
2023-07-12 10:50:21 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="Starting http server at"
|
|
|
|
ynh_systemd_action --service_name=$app-ui --action="start" --log_path="/var/log/$app/$app-ui.log"
|
|
|
|
ynh_systemd_action --service_name=$app-pict-rs --action="start" --log_path="/var/log/$app/$app-pict-rs.log" #--line_match="http://0.0.0.0"
|
2023-05-26 17:16:13 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Change of URL completed for $app" --last
|