mirror of
https://github.com/YunoHost-Apps/mumbleserver_ynh.git
synced 2024-09-03 19:46:03 +02:00
commit
c3f4863564
6 changed files with 70 additions and 41 deletions
|
@ -5,5 +5,3 @@ It install the Debian package and configures it with given settings.
|
||||||
#### Setup
|
#### Setup
|
||||||
|
|
||||||
- [Add the admin](http://wiki.mumble.info/wiki/Murmurguide#Connecting_to_Murmur_Server)
|
- [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.
|
|
||||||
|
|
|
@ -23,3 +23,15 @@
|
||||||
fail_download_source=0
|
fail_download_source=0
|
||||||
port_already_use=1
|
port_already_use=1
|
||||||
final_path_already_use=0
|
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
|
||||||
|
|
|
@ -6,11 +6,14 @@
|
||||||
"en": "Mumble is a libre, low-latency, high quality voice chat software primarily intended for use while gaming.",
|
"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."
|
"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",
|
"license": "free",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "Matlink",
|
"name": "Moul",
|
||||||
"email": "matlink@matlink.fr"
|
"email": "moul@moul.re"
|
||||||
|
},
|
||||||
|
"requirements": {
|
||||||
|
"yunohost": ">> 2.4.0"
|
||||||
},
|
},
|
||||||
"multi_instance": false,
|
"multi_instance": false,
|
||||||
"services": [
|
"services": [
|
||||||
|
|
|
@ -1,59 +1,64 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
#debug commands
|
#debug commands
|
||||||
#exec > >(tee /tmp/mumble-install.log)
|
#exec > >(tee /tmp/mumble-install.log)
|
||||||
#exec 2>&1
|
#exec 2>&1
|
||||||
|
|
||||||
app=mumbleserver
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
server_password=$1
|
app="mumbleserver"
|
||||||
su_passwd=$2
|
server_password=$YNH_APP_ARG_SERVER_LOGIN_PASSWORD
|
||||||
welcometext=$3
|
su_passwd=$YNH_APP_ARG_PASSWORD
|
||||||
port=$4
|
welcometext=$YNH_APP_ARG_WELCOMETEXT
|
||||||
registerName=$5
|
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
|
# Check port availability
|
||||||
sudo yunohost app checkport $port
|
sudo yunohost app checkport $port
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
exit 1
|
ynh_die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check if su_password is not empty
|
# Check if su_password is not empty
|
||||||
if [[ -z "$su_passwd" ]]; then
|
if [[ -z "$su_passwd" ]]; then
|
||||||
exit 1
|
ynh_die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Save app settings
|
# Save app settings
|
||||||
sudo yunohost app setting $app port -v "$port"
|
ynh_app_setting_set $app port "$port"
|
||||||
|
|
||||||
# install via apt-get
|
# Install Mumble Debian package via apt
|
||||||
sudo apt-get update > /dev/null 2>&1
|
sudo apt update > /dev/null 2>&1
|
||||||
sudo apt-get install -y mumble-server > /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 cp ../conf/mumble-server.ini $mumble_conf
|
||||||
sudo chmod 660 $mumble_conf
|
sudo chmod 660 $mumble_conf
|
||||||
sudo chown :mumble-server $mumble_conf
|
sudo chown :mumble-server $mumble_conf
|
||||||
|
|
||||||
#configuring with given settings
|
# Open port in firewall
|
||||||
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
|
|
||||||
sudo yunohost firewall allow Both $port > /dev/null 2>&1
|
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
|
sudo /etc/init.d/mumble-server start
|
||||||
|
|
||||||
#setting super-user password
|
# Set super-user password
|
||||||
sudo murmurd -supw $su_passwd
|
sudo murmurd -supw $su_passwd
|
||||||
#restart mumble server
|
|
||||||
|
# Restart Mumble server
|
||||||
sudo /etc/init.d/mumble-server restart
|
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
|
sudo yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log
|
||||||
|
|
|
@ -1,14 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit and treat unset variables as an error
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# Source YunoHost helpers
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
app=mumbleserver
|
app=mumbleserver
|
||||||
#getting port used by mumble to close it
|
|
||||||
port=$(sudo yunohost app setting $app port)
|
# Getting port used by mumble to close it
|
||||||
#uninstall mumble and its dependencies
|
port=$(ynh_app_setting_get $app port)
|
||||||
sudo apt-get autoremove -y mumble-server > /dev/null 2>&1
|
|
||||||
#close ports
|
# 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 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
|
sudo rm -f /etc/mumble-server.ini
|
||||||
|
|
||||||
# Remove mumble-server service
|
# Remove mumble-server service
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Exit on command errors and treat unset variables as an error
|
||||||
|
set -eu
|
||||||
|
|
Loading…
Add table
Reference in a new issue