-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupgrade
45 lines (36 loc) · 1.6 KB
/
upgrade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
ynh_print_info --message="Ensuring downward compatibility..."
# Making sure the current config panel is not being overidden by the upgrade
# We copy the current over the temporary one deployed during the upgrade
# It is being copied back over after the end of this upgrade script
cp /etc/yunohost/apps/$app/config_panel.toml $YNH_APP_BASEDIR
#=================================================
# SETUP SYSTEMD
#=================================================
ynh_print_info --message="Upgrading systemd configuration..."
# Create dedicated systemd configs for starting and monitoring WireGuard's configuration
ynh_add_config --template="[email protected]" --destination="/etc/systemd/system/[email protected]"
systemctl daemon-reload
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app: "$install_dir"
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Upgrade of $app completed."