mirror of
https://github.com/YunoHost-Apps/mumbleserver_ynh.git
synced 2024-09-03 19:46:03 +02:00
84 lines
2.9 KiB
Bash
84 lines
2.9 KiB
Bash
#!/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
|