2014-08-27 23:42:00 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-10-11 15:21:19 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2022-02-03 19:34:23 +01:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=2
|
2021-07-09 07:31:16 +02:00
|
|
|
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_setup_source --source_id="main" --dest_dir="$install_dir"
|
2021-07-09 07:31:16 +02:00
|
|
|
|
2022-02-03 23:58:23 +01:00
|
|
|
#=================================================
|
|
|
|
# ADD A CONFIGURATION
|
|
|
|
#=================================================
|
2022-02-04 08:49:44 +01:00
|
|
|
ynh_script_progression --message="Adding a configuration file..." --weight=1
|
2022-02-03 23:56:15 +01:00
|
|
|
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_add_config --template="config.conf" --destination="$install_dir/config.conf"
|
|
|
|
chmod 400 "$install_dir/config.conf"
|
2022-02-03 23:56:15 +01:00
|
|
|
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_add_config --template="client.json" --destination="$install_dir/www/static/client.json"
|
|
|
|
chmod 400 "$install_dir/www/static/client.json"
|
2024-02-05 14:30:09 +01:00
|
|
|
|
2024-02-05 14:37:30 +01:00
|
|
|
chmod 750 "$install_dir"
|
2024-02-05 14:30:09 +01:00
|
|
|
chown -R "$app:www-data" "$install_dir"
|
2022-02-03 20:07:15 +01:00
|
|
|
|
2020-10-11 15:21:19 +02:00
|
|
|
#=================================================
|
2024-02-05 13:11:42 +01:00
|
|
|
# SYSTEM CONFIGURATION
|
2020-10-11 15:21:19 +02:00
|
|
|
#=================================================
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2020-10-11 15:21:19 +02:00
|
|
|
|
|
|
|
# Create a dedicated NGINX config
|
|
|
|
ynh_add_nginx_config
|
|
|
|
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_add_systemd_config
|
|
|
|
yunohost service add "$app" --description="Versatile web based messenger using IRC" --log="/var/log/$app.log"
|
2020-10-25 09:00:51 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# START SYSTEMD SERVICE
|
|
|
|
#=================================================
|
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
|
|
|
|
|
|
|
# Start a systemd service
|
2024-02-05 13:11:42 +01:00
|
|
|
ynh_systemd_action --service_name="$app" --action="restart" --log_path="systemd"
|
2020-10-11 15:21:19 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2014-08-27 23:42:00 +02:00
|
|
|
|
2021-09-24 07:43:11 +02:00
|
|
|
ynh_script_progression --message="Installation of $app completed" --last
|