diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 2463654..948debe 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -4,7 +4,7 @@ SuperUser Password : __SU_PASSWD__ Welcome text : __WELCOMETEXT__ Root channel (your Mumble server name): __REGISTERNAME__ 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. If you changed it manually and upgrade mumble, you'll find a backup in __INSTALL_DIR__. diff --git a/scripts/install b/scripts/install index 591a6ac..982910f 100644 --- a/scripts/install +++ b/scripts/install @@ -34,14 +34,11 @@ ynh_app_setting_set --app=$app --key=instance_id --value="$instance_id" #================================================= # 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" -# Configuring with given settings -mumble_conf="$install_dir/mumble-server.ini" - -ynh_add_config --template="mumble-server.ini" --destination="$mumble_conf" +ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini" chmod -R 770 "$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 # 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 @@ -68,11 +65,6 @@ ynh_exec_warn_less murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" systemctl stop mumble-server systemctl disable mumble-server --quiet -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - # Create a dedicated systemd config ynh_add_systemd_config diff --git a/scripts/remove b/scripts/remove index 1675087..4f1a654 100644 --- a/scripts/remove +++ b/scripts/remove @@ -25,13 +25,6 @@ fi # Remove the dedicated 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" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 067b459..76ff2b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,7 +22,7 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= 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 @@ -30,7 +30,7 @@ ynh_systemd_action --service_name=$app --action="stop" ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # test old time -if [ -z "$server_password" ]; then +if [ -z "${server_password:-}" ]; then old_mumble_conf="/etc/mumble-server.ini" server_password=$(cat "$old_mumble_conf" \ @@ -66,19 +66,19 @@ fi # Fix SSO issue # https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/19 -if [ -z "$no_sso" ]; then - ynh_app_setting_set "$app" no_sso "true" +if [ -z "${no_sso:-}" ]; then + ynh_app_setting_set --app="$app" --key=no_sso --value="true" fi # Fix multi installation -if [ -z "$instance_id" ]; then +if [ -z "${instance_id:-}" ]; then 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 -if [ -z "$registername" ]; then -#REMOVEME? registername=$(ynh_app_setting_get "$app" registerName) - ynh_app_setting_set "$app" registername "$registername" +if [ -z "${registername:-}" ]; then + registername=$(ynh_app_setting_get "$app" registerName) + ynh_app_setting_set --app="$app" --key=registername --value="$registername" ynh_app_setting_delete "$app" registerName fi @@ -91,10 +91,7 @@ ynh_script_progression --message="Updating a configuration file..." --weight=1 mkdir -p $install_dir -# Configuring with given settings -mumble_conf="$install_dir/mumble-server.ini" - -ynh_add_config --template="../conf/mumble-server.ini" --destination="$mumble_conf" +ynh_add_config --template="mumble-server.ini" --destination="$install_dir/mumble-server.ini" chmod -R 770 "$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 # 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 @@ -128,13 +125,6 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 # Create a dedicated 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 yunohost service add $app --description="Mumble server" --log="/var/log/mumble-server/$app.log" --needs_exposed_ports="$port"