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-08-28 16:34:15 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2021-02-13 19:34:25 +01:00
|
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
2017-08-28 16:34:15 +02:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
# Create a dedicated NGINX config
|
2017-08-28 16:34:15 +02:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
# ADD A CONFIGURATION
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=2
|
2017-08-28 16:34:15 +02:00
|
|
|
|
2022-01-04 23:32:01 +01:00
|
|
|
ynh_add_config --template="../conf/shellinabox" --destination="/etc/default/shellinabox"
|
2018-03-08 00:25:33 +01:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
#=================================================
|
|
|
|
# SETUP SYSTEMD
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Configuring a systemd service..."
|
|
|
|
|
2018-03-08 00:25:33 +01:00
|
|
|
# Allow the service to log in syslog
|
2019-05-20 17:03:46 +02:00
|
|
|
ynh_replace_string --match_string=" -- -q --background" --replace_string=" -- --background" --target_file="/etc/init.d/shellinabox"
|
2018-03-08 00:51:15 +01:00
|
|
|
systemctl daemon-reload
|
2018-03-08 00:25:33 +01:00
|
|
|
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
2022-06-29 03:45:27 +02:00
|
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
2017-08-28 16:34:15 +02:00
|
|
|
#=================================================
|
2022-01-04 23:32:01 +01:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
2015-05-08 12:03:12 +02:00
|
|
|
|
2022-01-04 23:32:01 +01:00
|
|
|
yunohost service add $app --description="Web based AJAX terminal emulator"
|
2015-05-08 12:03:12 +02:00
|
|
|
|
2022-06-29 03:45:27 +02:00
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
|
|
|
|
|
|
|
# Start 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="Installation of $app completed" --last
|