mirror of
https://github.com/YunoHost-Apps/lemmy_ynh.git
synced 2024-09-03 19:36:09 +02:00
Create change_url
This commit is contained in:
parent
7ca7f9eb2d
commit
0602e29157
1 changed files with 54 additions and 0 deletions
54
scripts/change_url
Normal file
54
scripts/change_url
Normal file
|
@ -0,0 +1,54 @@
|
|||
#!/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
|
||||
|
||||
#=================================================
|
||||
# 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
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="start" --line_match="Starting http server at" --log_path="/var/log/$app/$app.log"
|
||||
ynh_systemd_action --service_name=$app-ui --action="start" --line_match="http://0.0.0.0" --log_path="/var/log/$app/$app-ui.log"
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Change of URL completed for $app" --last
|
Loading…
Add table
Reference in a new issue