2018-09-14 05:20:02 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
2022-03-13 16:50:54 +01:00
|
|
|
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
|
2020-11-08 11:26:35 +01:00
|
|
|
source ../settings/scripts/_common.sh
|
2018-09-14 05:20:02 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2018-09-28 12:38:03 +02:00
|
|
|
#=================================================
|
2022-03-13 16:50:54 +01:00
|
|
|
# ADD A CONFIGURATION
|
2018-09-28 12:38:03 +02:00
|
|
|
#=================================================
|
2022-03-13 16:50:54 +01:00
|
|
|
ynh_script_progression --message="Adding a configuration file..."
|
2018-09-28 12:38:03 +02:00
|
|
|
|
2024-02-01 11:54:07 +01:00
|
|
|
ynh_secure_remove --file="/etc/squid/squid.conf"
|
|
|
|
ynh_add_config --template="squid.conf" --destination="/etc/squid/squid.conf"
|
2022-03-13 16:50:54 +01:00
|
|
|
|
2018-09-14 05:20:02 +02:00
|
|
|
#=================================================
|
2024-01-31 21:35:45 +01:00
|
|
|
# RESTORE SYSTEM CONFIGURATIONS
|
2018-09-14 05:20:02 +02:00
|
|
|
#=================================================
|
2024-01-31 21:35:45 +01:00
|
|
|
ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1
|
2022-03-13 16:50:54 +01:00
|
|
|
|
2024-02-01 11:54:07 +01:00
|
|
|
yunohost service add "squid" --description "Squid3 a web proxy service" --log="/var/log/squid/access.log" --needs_exposed_ports "$port"
|
2022-03-13 16:50:54 +01:00
|
|
|
|
2018-09-14 05:20:02 +02:00
|
|
|
#=================================================
|
2022-03-13 16:50:54 +01:00
|
|
|
# START SYSTEMD SERVICE
|
2018-09-14 05:20:02 +02:00
|
|
|
#=================================================
|
2022-03-13 16:50:54 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..."
|
2018-09-14 05:20:02 +02:00
|
|
|
|
2022-03-13 16:50:54 +01:00
|
|
|
# Start a systemd service
|
2024-02-01 11:54:07 +01:00
|
|
|
ynh_systemd_action --service_name="squid" --action="restart" --log_path="/var/log/squid/cache.log"
|
2020-10-17 12:08:40 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2020-11-08 11:26:35 +01:00
|
|
|
ynh_script_progression --message="Restoration completed for $app"
|