mirror of
https://github.com/YunoHost-Apps/mumbleserver_ynh.git
synced 2024-09-03 19:46:03 +02:00
change install file structure
This commit is contained in:
parent
6e7df45f12
commit
c736ccf103
1 changed files with 53 additions and 5 deletions
|
@ -28,6 +28,10 @@ welcometext=$YNH_APP_ARG_WELCOMETEXT
|
||||||
port=$YNH_APP_ARG_PORT
|
port=$YNH_APP_ARG_PORT
|
||||||
registerName=$YNH_APP_ARG_REGISTERNAME
|
registerName=$YNH_APP_ARG_REGISTERNAME
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Check port availability
|
# Check port availability
|
||||||
yunohost app checkport $port
|
yunohost app checkport $port
|
||||||
if [[ ! $? -eq 0 ]]; then
|
if [[ ! $? -eq 0 ]]; then
|
||||||
|
@ -39,13 +43,39 @@ if [[ -z "$su_passwd" ]]; then
|
||||||
ynh_die
|
ynh_die
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STORE SETTINGS FROM MANIFEST
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Save app settings
|
# Save app settings
|
||||||
ynh_app_setting_set $app port "$port"
|
ynh_app_setting_set $app port "$port"
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# STANDARD MODIFICATIONS
|
||||||
|
#=================================================
|
||||||
|
# FIND AND OPEN A PORT
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Open port in firewall
|
||||||
|
yunohost firewall allow Both $port > /dev/null 2>&1
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# INSTALL DEPENDENCIES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Install Mumble Debian package via apt
|
# Install Mumble Debian package via apt
|
||||||
apt update > /dev/null 2>&1
|
apt update > /dev/null 2>&1
|
||||||
apt install -y mumble-server > /dev/null 2>&1
|
apt install -y mumble-server > /dev/null 2>&1
|
||||||
|
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# SPECIFIC SETUP
|
||||||
|
#=================================================
|
||||||
|
# mumble server conf.ini
|
||||||
|
#=================================================
|
||||||
|
# TODO: clean this
|
||||||
|
|
||||||
# Configuring with given settings
|
# Configuring with given settings
|
||||||
mumble_conf="../conf/mumble-server.ini"
|
mumble_conf="../conf/mumble-server.ini"
|
||||||
sed -i "s/welcometext=.*/welcometext=$welcometext/" $mumble_conf
|
sed -i "s/welcometext=.*/welcometext=$welcometext/" $mumble_conf
|
||||||
|
@ -56,20 +86,38 @@ sed -i "s/#registerName=.*/registerName=$registerName/" $mumble_conf
|
||||||
# Copying conf file
|
# Copying conf file
|
||||||
mumble_conf="/etc/mumble-server.ini"
|
mumble_conf="/etc/mumble-server.ini"
|
||||||
cp ../conf/mumble-server.ini $mumble_conf
|
cp ../conf/mumble-server.ini $mumble_conf
|
||||||
chmod 660 $mumble_conf
|
|
||||||
chown :mumble-server $mumble_conf
|
|
||||||
|
|
||||||
# Open port in firewall
|
#=================================================
|
||||||
yunohost firewall allow Both $port > /dev/null 2>&1
|
# STORE THE CHECKSUM OF THE CONFIG FILE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# TODO: add this checksum step
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# Start services
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Start Mumble server
|
# Start Mumble server
|
||||||
/etc/init.d/mumble-server start
|
/etc/init.d/mumble-server start
|
||||||
|
|
||||||
# Set super-user password
|
# Set super-user password
|
||||||
murmurd -supw $su_passwd
|
murmurd -ini $mumble_conf -supw $su_passwd
|
||||||
|
|
||||||
# Restart Mumble server
|
# Restart Mumble server
|
||||||
/etc/init.d/mumble-server restart
|
/etc/init.d/mumble-server restart
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC FINALIZATION
|
||||||
|
#=================================================
|
||||||
|
# SECURE FILES AND DIRECTORIES
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
chmod 660 $mumble_conf
|
||||||
|
chown :mumble-server $mumble_conf
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# ADVERTISE SERVICE IN ADMIN PANEL
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# Add Mumble as a YunoHost service
|
# Add Mumble as a YunoHost service
|
||||||
yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log
|
yunohost service add mumble-server -l /var/log/mumble-server/mumble-server.log
|
||||||
|
|
Loading…
Add table
Reference in a new issue