-
Notifications
You must be signed in to change notification settings - Fork 4
/
install
84 lines (61 loc) · 2.93 KB
/
install
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# doc: https://wiki.mumble.info/wiki/Running_Murmur
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
server_password=$(ynh_string_random)
su_passwd=$(ynh_string_random)
instance_id=$YNH_APP_INSTANCE_NUMBER
#=================================================
# STORE SETTINGS FROM MANIFEST
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=no_sso --value="true"
ynh_app_setting_set --app=$app --key=server_password --value="$server_password"
ynh_app_setting_set --app=$app --key=su_passwd --value="$su_passwd"
ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id"
#=================================================
# SPECIFIC SETUP
#=================================================
# ADD A CONFIGURATION
#=================================================
ynh_script_progression --message="Adding a configuration file..." --weight=2
mkdir -p "$install_dir"
ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini"
chmod -R 770 "$install_dir"
chown -R :mumble-server "$install_dir"
#=================================================
# ADD USER TO SSL-CERT
#=================================================
# Add user to ssl-cert so it can read certificates
usermod --append --groups ssl-cert mumble-server
#=================================================
# Set SuperUser password
#=================================================
# || true temporarily to ignore a bug in murmurd 1.3.0
# https://github.com/mumble-voip/mumble/issues/3911
#ynh_exec_warn_less murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true
#=================================================
# Disable default server installed by Debian's package
#=================================================
systemctl stop mumble-server
systemctl disable mumble-server --quiet
# Create a dedicated systemd config
ynh_add_systemd_config
yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port"
#=================================================
# START SYSTEMD SERVICE
#=================================================
ynh_script_progression --message="Starting a systemd service..." --weight=3
ynh_systemd_action --service_name=$app --action=restart --log_path="/var/log/mumble-server/$app.log"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last