1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/shellinabox_ynh.git synced 2024-09-03 20:26:12 +02:00
shellinabox_ynh/scripts/upgrade

71 lines
2.4 KiB
Text
Raw Permalink Normal View History

2015-05-08 12:03:12 +02:00
#!/bin/bash
2017-08-28 16:34:15 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2017-04-20 19:34:26 +02:00
2021-02-13 19:19:24 +01:00
source _common.sh
2017-04-20 19:34:26 +02:00
source /usr/share/yunohost/helpers
2017-08-28 16:34:15 +02:00
#=================================================
2022-06-29 03:45:27 +02:00
# CHECK VERSION
2017-08-28 16:34:15 +02:00
#=================================================
2015-05-08 12:03:12 +02:00
2022-06-29 03:45:27 +02:00
upgrade_type=$(ynh_check_app_version_changed)
2015-05-08 12:03:12 +02:00
2017-08-28 16:34:15 +02:00
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
2022-06-29 03:45:27 +02:00
# STOP SYSTEMD SERVICE
2017-08-28 16:34:15 +02:00
#=================================================
2022-06-29 03:45:27 +02:00
ynh_script_progression --message="Stopping a systemd service..."
2017-08-28 16:34:15 +02:00
2022-06-29 03:45:27 +02:00
ynh_systemd_action --service_name=$app --action="stop"
#=================================================
2022-06-29 03:45:27 +02:00
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Create a dedicated NGINX config
ynh_add_nginx_config
#=================================================
# SPECIFIC UPGRADE
#=================================================
2022-06-29 03:45:27 +02:00
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..." --weight=4
2022-01-04 23:32:01 +01:00
ynh_add_config --template="../conf/shellinabox" --destination="/etc/default/shellinabox"
2022-06-29 03:45:27 +02:00
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_script_progression --message="Upgrading systemd configuration..."
2019-05-20 17:03:46 +02:00
ynh_replace_string --match_string=" -- -q --background" --replace_string=" -- --background" --target_file="/etc/init.d/shellinabox"
systemctl daemon-reload
2021-02-13 19:19:24 +01:00
#=================================================
2022-06-29 03:45:27 +02:00
# INTEGRATE SERVICE IN YUNOHOST
2021-02-13 19:19:24 +01:00
#=================================================
2022-01-04 23:32:01 +01:00
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
2021-02-13 19:19:24 +01:00
2022-01-04 23:32:01 +01:00
yunohost service add $app --description="Web based AJAX terminal emulator"
2021-02-13 19:19:24 +01:00
2022-06-29 03:45:27 +02:00
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..."
ynh_systemd_action --service_name=shellinabox --action=restart
2019-03-04 16:24:27 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2019-05-20 17:03:46 +02:00
ynh_script_progression --message="Upgrade of $app completed" --last