1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mumbleserver_ynh.git synced 2024-09-03 19:46:03 +02:00

Merge pull request #9 from YunoHost-Apps/updates

Updates
This commit is contained in:
M5oul 2017-07-11 21:40:12 +02:00 committed by GitHub
commit c3f4863564
6 changed files with 70 additions and 41 deletions

View file

@ -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.

View file

@ -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

View file

@ -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": [

View file

@ -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
# Add Mumble as a YunoHost service
sudo yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log

View file

@ -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

View file

@ -1,2 +1,4 @@
#!/bin/bash
# Exit on command errors and treat unset variables as an error
set -eu