From 6ab9c0a2ecfa01c73b796e5da43d4ce518b84206 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 1 Aug 2020 23:53:10 +0200 Subject: [PATCH] clean up --- README.md | 1 - scripts/_common.sh | 20 ++++++++++++++++++++ scripts/install | 13 +++++++------ scripts/upgrade | 6 ++++++ 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2b7f31a..da8e852 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Password and other usefull information will be sent to you after installation. - [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server) #### Maintainers & history ----------------- * 2014: Package creation was maid by [matlink]](https://github.com/Matlink) * 2016: improved and maintained by [Moul](https://github.com/M5oul) diff --git a/scripts/_common.sh b/scripts/_common.sh index fba63ec..7eda170 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,5 +1,25 @@ #!/bin/bash +#================================================= +# COMMON VARIABLES +#================================================= + +# dependencies used by the app +pkg_dependencies="mumble-server mailutils" + +#================================================= +# PERSONAL HELPERS +#================================================= + +#================================================= +# EXPERIMENTAL HELPERS +#================================================= + +#================================================= +# FUTURE OFFICIAL HELPERS +#================================================= + + # Send an email to inform the administrator # # usage: ynh_send_readme_to_admin app_message [recipients] diff --git a/scripts/install b/scripts/install index b202953..3424aa5 100644 --- a/scripts/install +++ b/scripts/install @@ -59,7 +59,7 @@ ynh_app_setting_set "$app" instance_id "$instance_id" #================================================= port=$(ynh_find_port 64738) -ynh_app_setting_set "$app" port "$port" +ynh_app_setting_set --app=$app --key=port --value=$port # Open port in firewall yunohost firewall allow Both "$port" @@ -69,7 +69,8 @@ yunohost firewall allow Both "$port" #================================================= # Install Mumble Debian package via apt -ynh_install_app_dependencies mumble-server mailutils + +ynh_install_app_dependencies $pkg_dependencies #================================================= # SPECIFIC SETUP @@ -109,13 +110,13 @@ ynh_add_systemd_config #================================================= chmod -R 770 "$final_path" -chown -R :mumble-server "$final_path" +chown -R :$app "$final_path" #================================================= # Add user to ssl-cert so it can read certificates #================================================= -usermod --append --groups ssl-cert mumble-server +usermod --append --groups ssl-cert $app #================================================= # Set SuperUser password @@ -129,8 +130,8 @@ murmurd -ini "$mumble_conf" -supw "$su_passwd" "$instance_id" || true # Disable default server installed by Debian's package #================================================= -systemctl stop mumble-server -systemctl disable mumble-server +systemctl stop $app +systemctl disable $app #================================================= # ADVERTISE SERVICE IN ADMIN PANEL diff --git a/scripts/upgrade b/scripts/upgrade index a257cd2..d269e51 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -211,3 +211,9 @@ Are you facing an issue, want to improve this app or say thank you? Please open a new issue in this project: https://github.com/YunoHost-Apps/mumbleserver_ynh " ynh_send_readme_to_admin "$message" + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Upgrade of $app completed" --last