diff --git a/README.md b/README.md index 562bc0a..c209948 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,3 @@ It install the Debian package and configures it with given settings. #### Setup - [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server) - -email me at matlink@matlink.fr if you need something or to give me feedback about this app. diff --git a/check_process b/check_process index 8931f14..bb4a25d 100644 --- a/check_process +++ b/check_process @@ -23,3 +23,15 @@ fail_download_source=0 port_already_use=1 final_path_already_use=0 +;;; Levels + Level 1=auto + Level 2=auto + Level 3=auto + # https://github.com/YunoHost-Apps/mumbleserver_ynh/issues/11 + Level 4=1 + Level 5=auto + Level 6=auto + Level 7=auto + Level 8=0 + Level 9=0 + Level 10=0 diff --git a/manifest.json b/manifest.json index 99ffb32..fd6a149 100644 --- a/manifest.json +++ b/manifest.json @@ -6,11 +6,14 @@ "en": "Mumble is a libre, low-latency, high quality voice chat software primarily intended for use while gaming.", "fr": "Mumble est un logiciel libre de voix sur IP (VoIP), son principal usage étant la communication pendant les parties de jeux en réseau." }, - "url": "http://mumble.info", + "url": "https://mumble.info", "license": "free", "maintainer": { - "name": "Matlink", - "email": "matlink@matlink.fr" + "name": "Moul", + "email": "moul@moul.re" + }, + "requirements": { + "yunohost": ">> 2.4.0" }, "multi_instance": false, "services": [ diff --git a/scripts/install b/scripts/install index aae19da..4b67ab7 100644 --- a/scripts/install +++ b/scripts/install @@ -1,59 +1,64 @@ #!/bin/bash - #debug commands #exec > >(tee /tmp/mumble-install.log) #exec 2>&1 -app=mumbleserver +# Exit on command errors and treat unset variables as an error +set -eu # Retrieve arguments -server_password=$1 -su_passwd=$2 -welcometext=$3 -port=$4 -registerName=$5 +app="mumbleserver" +server_password=$YNH_APP_ARG_SERVER_LOGIN_PASSWORD +su_passwd=$YNH_APP_ARG_PASSWORD +welcometext=$YNH_APP_ARG_WELCOMETEXT +port=$YNH_APP_ARG_PORT +registerName=$YNH_APP_ARG_REGISTERNAME + +# Source YunoHost helpers +source /usr/share/yunohost/helpers -mumble_conf=/etc/mumble-server.ini # Check port availability sudo yunohost app checkport $port if [[ ! $? -eq 0 ]]; then - exit 1 + ynh_die fi -#check if su_password is not empty +# Check if su_password is not empty if [[ -z "$su_passwd" ]]; then - exit 1 + ynh_die fi # Save app settings -sudo yunohost app setting $app port -v "$port" +ynh_app_setting_set $app port "$port" -# install via apt-get -sudo apt-get update > /dev/null 2>&1 -sudo apt-get install -y mumble-server > /dev/null 2>&1 +# Install Mumble Debian package via apt +sudo apt update > /dev/null 2>&1 +sudo apt install -y mumble-server > /dev/null 2>&1 -#copying conf file +# Configuring with given settings +mumble_conf="../conf/mumble-server.ini" +sudo sed -i "s/welcometext=.*/welcometext=$welcometext/" $mumble_conf +sudo sed -i "s/port=.*/port=$port/" $mumble_conf +sudo sed -i "s/serverpassword=.*/serverpassword=$server_password/" $mumble_conf +sudo sed -i "s/#registerName=.*/registerName=$registerName/" $mumble_conf + +# Copying conf file +mumble_conf="/etc/mumble-server.ini" sudo cp ../conf/mumble-server.ini $mumble_conf sudo chmod 660 $mumble_conf sudo chown :mumble-server $mumble_conf -#configuring with given settings -sudo sed -i "s/welcometext=.*/welcometext=$welcometext/g" $mumble_conf -sudo sed -i "s/port=.*/port=$port/g" $mumble_conf -sudo sed -i "s/serverpassword=.*/serverpassword=$server_password/g" $mumble_conf -sudo sed -i "s/#registerName=.*/registerName=$registerName/g" $mumble_conf - -#open port in firewall +# Open port in firewall sudo yunohost firewall allow Both $port > /dev/null 2>&1 -sudo yunohost firewall allow --ipv6 Both $port > /dev/null 2>&1 -#starting mumble server +# Start Mumble server sudo /etc/init.d/mumble-server start -#setting super-user password +# Set super-user password sudo murmurd -supw $su_passwd -#restart mumble server + +# Restart Mumble server sudo /etc/init.d/mumble-server restart -#adding mumble as a service -sudo yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log \ No newline at end of file +# Add Mumble as a YunoHost service +sudo yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log diff --git a/scripts/remove b/scripts/remove index 6496857..53bd38f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,14 +1,23 @@ #!/bin/bash +# Exit and treat unset variables as an error +set -u + +# Source YunoHost helpers +source /usr/share/yunohost/helpers + app=mumbleserver -#getting port used by mumble to close it -port=$(sudo yunohost app setting $app port) -#uninstall mumble and its dependencies -sudo apt-get autoremove -y mumble-server > /dev/null 2>&1 -#close ports + +# Getting port used by mumble to close it +port=$(ynh_app_setting_get $app port) + +# Uninstall Mumble and its dependencies +sudo apt autoremove -y mumble-server > /dev/null 2>&1 + +# Close ports sudo yunohost firewall disallow Both $port > /dev/null 2>&1 -sudo yunohost firewall disallow --ipv6 Both $port > /dev/null 2>&1 -#removing config file + +# Removing config file sudo rm -f /etc/mumble-server.ini # Remove mumble-server service diff --git a/scripts/upgrade b/scripts/upgrade index 05a7907..a1a1178 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,2 +1,4 @@ #!/bin/bash +# Exit on command errors and treat unset variables as an error +set -eu