mirror of
https://github.com/YunoHost-Apps/mumbleserver_ynh.git
synced 2024-09-03 19:46:03 +02:00
cleaning
This commit is contained in:
parent
a1200d6a08
commit
867cf3673e
4 changed files with 15 additions and 40 deletions
|
@ -4,7 +4,7 @@ SuperUser Password : __SU_PASSWD__
|
||||||
Welcome text : __WELCOMETEXT__
|
Welcome text : __WELCOMETEXT__
|
||||||
Root channel (your Mumble server name): __REGISTERNAME__
|
Root channel (your Mumble server name): __REGISTERNAME__
|
||||||
Final path (where to find your files) : __INSTALL_DIR__
|
Final path (where to find your files) : __INSTALL_DIR__
|
||||||
Mumble configuration file : __MUMBLE_CONF__
|
Mumble configuration file : __INSTALL_DIR__/mumble-server.ini
|
||||||
|
|
||||||
Note about config file: this package will regenerate the config file on upgrade.
|
Note about config file: this package will regenerate the config file on upgrade.
|
||||||
If you changed it manually and upgrade mumble, you'll find a backup in __INSTALL_DIR__.
|
If you changed it manually and upgrade mumble, you'll find a backup in __INSTALL_DIR__.
|
||||||
|
|
|
@ -34,14 +34,11 @@ ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id"
|
||||||
#=================================================
|
#=================================================
|
||||||
# ADD A CONFIGURATION
|
# ADD A CONFIGURATION
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Adding a configuration file..."
|
ynh_script_progression --message="Adding a configuration file..." --weight=2
|
||||||
|
|
||||||
mkdir -p "$install_dir"
|
mkdir -p "$install_dir"
|
||||||
|
|
||||||
# Configuring with given settings
|
ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini"
|
||||||
mumble_conf="$install_dir/mumble-server.ini"
|
|
||||||
|
|
||||||
ynh_add_config --template="mumble-server.ini" --destination="$mumble_conf"
|
|
||||||
|
|
||||||
chmod -R 770 "$install_dir"
|
chmod -R 770 "$install_dir"
|
||||||
chown -R :mumble-server "$install_dir"
|
chown -R :mumble-server "$install_dir"
|
||||||
|
@ -59,7 +56,7 @@ usermod --append --groups ssl-cert mumble-server
|
||||||
|
|
||||||
# || true temporarily to ignore a bug in murmurd 1.3.0
|
# || true temporarily to ignore a bug in murmurd 1.3.0
|
||||||
# https://github.com/mumble-voip/mumble/issues/3911
|
# https://github.com/mumble-voip/mumble/issues/3911
|
||||||
ynh_exec_warn_less murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" || true
|
#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
|
# Disable default server installed by Debian's package
|
||||||
|
@ -68,11 +65,6 @@ ynh_exec_warn_less murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id"
|
||||||
systemctl stop mumble-server
|
systemctl stop mumble-server
|
||||||
systemctl disable mumble-server --quiet
|
systemctl disable mumble-server --quiet
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SETUP SYSTEMD
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Configuring a systemd service..."
|
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
|
|
|
@ -25,13 +25,6 @@ fi
|
||||||
# Remove the dedicated systemd config
|
# Remove the dedicated systemd config
|
||||||
ynh_remove_systemd_config
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# SPECIFIC REMOVE
|
|
||||||
#=================================================
|
|
||||||
# REMOVE VARIOUS FILES
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Removing various files..."
|
|
||||||
|
|
||||||
ynh_secure_remove --file="/var/log/mumble-server/$app.log"
|
ynh_secure_remove --file="/var/log/mumble-server/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Stopping a systemd service..."
|
ynh_script_progression --message="Stopping a systemd service..."
|
||||||
|
|
||||||
ynh_systemd_action --service_name=$app --action="stop"
|
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/mumble-server/$app.log"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# ENSURE DOWNWARD COMPATIBILITY
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
@ -30,7 +30,7 @@ ynh_systemd_action --service_name=$app --action="stop"
|
||||||
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
# test old time
|
# test old time
|
||||||
if [ -z "$server_password" ]; then
|
if [ -z "${server_password:-}" ]; then
|
||||||
old_mumble_conf="/etc/mumble-server.ini"
|
old_mumble_conf="/etc/mumble-server.ini"
|
||||||
|
|
||||||
server_password=$(cat "$old_mumble_conf" \
|
server_password=$(cat "$old_mumble_conf" \
|
||||||
|
@ -66,19 +66,19 @@ fi
|
||||||
|
|
||||||
# Fix SSO issue
|
# Fix SSO issue
|
||||||
# https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19
|
# https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19
|
||||||
if [ -z "$no_sso" ]; then
|
if [ -z "${no_sso:-}" ]; then
|
||||||
ynh_app_setting_set "$app" no_sso "true"
|
ynh_app_setting_set --app="$app" --key=no_sso --value="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fix multi installation
|
# Fix multi installation
|
||||||
if [ -z "$instance_id" ]; then
|
if [ -z "${instance_id:-}" ]; then
|
||||||
instance_id=$YNH_APP_INSTANCE_NUMBER
|
instance_id=$YNH_APP_INSTANCE_NUMBER
|
||||||
ynh_app_setting_set "$app" instance_id "$instance_id"
|
ynh_app_setting_set --app="$app" instance_id --value="$instance_id"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$registername" ]; then
|
if [ -z "${registername:-}" ]; then
|
||||||
#REMOVEME? registername=$(ynh_app_setting_get "$app" registerName)
|
registername=$(ynh_app_setting_get "$app" registerName)
|
||||||
ynh_app_setting_set "$app" registername "$registername"
|
ynh_app_setting_set --app="$app" --key=registername --value="$registername"
|
||||||
ynh_app_setting_delete "$app" registerName
|
ynh_app_setting_delete "$app" registerName
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -91,10 +91,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1
|
||||||
|
|
||||||
mkdir -p $install_dir
|
mkdir -p $install_dir
|
||||||
|
|
||||||
# Configuring with given settings
|
ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini"
|
||||||
mumble_conf="$install_dir/mumble-server.ini"
|
|
||||||
|
|
||||||
ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf"
|
|
||||||
|
|
||||||
chmod -R 770 "$install_dir"
|
chmod -R 770 "$install_dir"
|
||||||
chown -R :mumble-server "$install_dir"
|
chown -R :mumble-server "$install_dir"
|
||||||
|
@ -111,7 +108,7 @@ usermod --append --groups ssl-cert mumble-server
|
||||||
|
|
||||||
# || true temporarily to ignore a bug in murmurd 1.3.0
|
# || true temporarily to ignore a bug in murmurd 1.3.0
|
||||||
# https://github.com/mumble-voip/mumble/issues/3911
|
# https://github.com/mumble-voip/mumble/issues/3911
|
||||||
murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" || true
|
murmurd -ini "$install_dir/mumble-server.ini" -supw "$su_passwd" "$instance_id" || true
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# Disable default server installed by Debian's package
|
# Disable default server installed by Debian's package
|
||||||
|
@ -128,13 +125,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
|
|
||||||
#=================================================
|
|
||||||
# GENERIC FINALIZATION
|
|
||||||
#=================================================
|
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
|
||||||
#=================================================
|
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
|
||||||
|
|
||||||
# Add Mumble as a YunoHost service
|
# Add Mumble as a YunoHost service
|
||||||
yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port"
|
yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue