2019-02-20 12:08:50 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2020-11-16 19:12:12 +01:00
|
|
|
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
2019-02-20 12:08:50 +01:00
|
|
|
|
2020-11-16 19:12:12 +01:00
|
|
|
# Create a dedicated NGINX config
|
2019-02-20 12:08:50 +01:00
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2022-03-13 21:51:45 +01:00
|
|
|
#=================================================
|
|
|
|
# SPECIFIC SETUP
|
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
|
|
|
|
|
|
|
ynh_replace_string --match_string="ListenStream=.*" --replace_string="ListenStream=$port" --target_file="/lib/systemd/system/cockpit.socket"
|
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl restart $app.socket
|
|
|
|
|
|
|
|
ynh_add_config --template="../conf/cockpit.conf" --destination="/etc/cockpit/cockpit.conf"
|
|
|
|
|
2023-08-12 10:34:03 +02:00
|
|
|
chmod 650 "/etc/cockpit/cockpit.conf"
|
2022-03-13 21:51:45 +01:00
|
|
|
chown root:$app-ws "/etc/cockpit/cockpit.conf"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
2020-11-16 19:38:35 +01:00
|
|
|
#=================================================
|
2021-12-06 23:12:58 +01:00
|
|
|
# INTEGRATE SERVICE IN YUNOHOST
|
2020-11-16 19:38:35 +01:00
|
|
|
#=================================================
|
2021-12-06 23:12:58 +01:00
|
|
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
2020-11-16 19:38:35 +01:00
|
|
|
|
2023-08-12 10:41:47 +02:00
|
|
|
yunohost service add $app --description="Sysadmin login session in a web browser" --log="/var/log/$app/$app.log"
|
2021-12-06 23:01:56 +01:00
|
|
|
|
|
|
|
#=================================================
|
2021-12-06 23:12:58 +01:00
|
|
|
# START SYSTEMD SERVICE
|
2021-12-06 23:01:56 +01:00
|
|
|
#=================================================
|
2021-12-06 23:12:58 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
2020-11-16 19:38:35 +01:00
|
|
|
|
2022-05-31 01:08:23 +02:00
|
|
|
# Start a systemd service
|
2022-03-13 21:51:45 +01:00
|
|
|
ynh_systemd_action --service_name=$app --action="restart" --log_path="systemd" --line_match="Started"
|
|
|
|
|
2019-02-20 12:08:50 +01:00
|
|
|
#=================================================
|
2020-11-16 19:12:12 +01:00
|
|
|
# END OF SCRIPT
|
2019-02-20 12:08:50 +01:00
|
|
|
#=================================================
|
|
|
|
|
2021-07-07 19:08:59 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|