Просмотр исходного кода

Merge remote-tracking branch 'refs/remotes/origin/master' into development

# Conflicts:
#	lgsm/functions/command_backup.sh
#	lgsm/functions/command_start.sh
#	lgsm/functions/command_ts3_server_pass.sh
#	lgsm/functions/install_logs.sh
#	lgsm/functions/install_ut2k4_key.sh
Daniel Gibbs 10 лет назад
Родитель
Сommit
f97922809e

+ 1 - 1
TeamFortressClassic/tfcserver

@@ -46,7 +46,7 @@ githubbranch="master"
 
 
 # Steam
 # Steam
 appid="90"
 appid="90"
-appidmos="tfc"
+appidmod="tfc"
 
 
 # Server Details
 # Server Details
 servicename="tfc-server"
 servicename="tfc-server"

+ 12 - 25
lgsm/functions/command_backup.sh

@@ -2,7 +2,7 @@
 # LGSM command_backup.sh function
 # LGSM command_backup.sh function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-lgsm_version="271215"
+lgsm_version="190316"
 
 
 # Description: Creates a .tar.gz file in the backup directory.
 # Description: Creates a .tar.gz file in the backup directory.
 
 
@@ -12,11 +12,7 @@ function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 check.sh
 check.sh
 backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 backupname="${servicename}-$(date '+%Y-%m-%d-%H%M%S')"
 echo ""
 echo ""
-echo "${gamename} Backup"
-echo "============================"
-echo ""
-echo "The following backup will be created:"
-echo ""
+fn_printinfonl "A total of $(du -sh "${rootdir}" --exclude="${backupdir}" | awk '{print $1}') will be compressed into the following backup:"
 echo "${backupdir}/${backupname}.tar.gz"
 echo "${backupdir}/${backupname}.tar.gz"
 echo ""
 echo ""
 while true; do
 while true; do
@@ -27,10 +23,11 @@ while true; do
 	* ) echo "Please answer yes or no.";;
 	* ) echo "Please answer yes or no.";;
 esac
 esac
 done
 done
+echo ""
 tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
 tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
 if [ "${tmuxwc}" -eq 1 ]; then
 if [ "${tmuxwc}" -eq 1 ]; then
 	echo ""
 	echo ""
-	fn_print_warning_nl "${servicename} is currently running."
+	fn_printwarningnl "${servicename} is currently running."
 	sleep 1
 	sleep 1
 	while true; do
 	while true; do
 		read -p "Stop ${servicename} while running the backup? [y/N]" yn
 		read -p "Stop ${servicename} while running the backup? [y/N]" yn
@@ -41,24 +38,14 @@ if [ "${tmuxwc}" -eq 1 ]; then
 	esac
 	esac
 	done
 	done
 fi
 fi
-fn_scriptlog "Started"
-echo -en "starting backup.\r"
-sleep 1
-echo -en "starting backup..\r"
-sleep 1
-echo -en "starting backup...\r"
-sleep 1
-echo -en "\n"
-cd "${rootdir}"
+fn_scriptlog "Started backup"
+fn_printdots "Backup in progress, please wait..."
+sleep 2
 if [ ! -d "${backupdir}" ]; then
 if [ ! -d "${backupdir}" ]; then
-	mkdir -v "${backupdir}"
+	mkdir "${backupdir}"
 fi
 fi
-tar -cvzf "${backupdir}/${backupname}.tar.gz" --exclude "${backupdir}" ./*
-echo ""
-echo "Backup created: ${backupdir}/${backupname}.tar.gz"
-fn_scriptlog "Created: ${backupdir}/${backupname}.tar.gz"
+tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "backups" ./*
+fn_printoknl "Backup created: ${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
+fn_scriptlog "Complete, Backup created: ${backupdir}/${backupname}.tar.gz is $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}') size"
 sleep 1
 sleep 1
-echo ""
-fn_print_complete_nl "Complete."
-fn_scriptlog "Complete"
-echo ""
+echo ""

+ 1 - 1
lgsm/functions/command_start.sh

@@ -52,7 +52,7 @@ fn_start_teamspeak3(){
 	date > "${rootdir}/${lockselfname}"
 	date > "${rootdir}/${lockselfname}"
 	cd "${executabledir}"
 	cd "${executabledir}"
 	if [ "${ts3serverpass}" == "1" ];then
 	if [ "${ts3serverpass}" == "1" ];then
-		./ts3server_startscript.sh start serveradmin_password="${newpassword}" 
+		./ts3server_startscript.sh start serveradmin_password="${newpassword}" inifile="${servercfgfullpath}"
 	else
 	else
 		./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1
 		./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1
 	fi
 	fi

+ 2 - 1
lgsm/functions/command_ts3_server_pass.sh

@@ -24,7 +24,7 @@ while true; do
 	read -e -i "y" -p "Continue? [y/N]" yn
 	read -e -i "y" -p "Continue? [y/N]" yn
 	case $yn in
 	case $yn in
 	[Yy]* ) break;;
 	[Yy]* ) break;;
-	[Nn]* ) echo Exiting; return;;
+	[Nn]* ) echo Exiting; exit;;
 	* ) echo "Please answer yes or no.";;
 	* ) echo "Please answer yes or no.";;
 esac
 esac
 done
 done
@@ -45,6 +45,7 @@ fn_print_info_nl "Starting server with new password"
 command_start.sh
 command_start.sh
 # Stop server in "new password mode"
 # Stop server in "new password mode"
 command_stop.sh
 command_stop.sh
+ts3serverpass="0"
 fn_print_ok_nl "Password applied"
 fn_print_ok_nl "Password applied"
 fn_scriptlog "New ServerAdmin password applied"
 fn_scriptlog "New ServerAdmin password applied"
 sleep 1
 sleep 1

+ 0 - 3
lgsm/functions/email.sh

@@ -50,9 +50,6 @@ fi
 		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
 		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
 	fi
 	fi
 	echo -e ""	
 	echo -e ""	
-	echo -e "========================================\nCommand-line Parameters\n========================================"
-	echo -e "${executable} ${parms}"
-	echo -e ""
 	echo -e "========================================\nLogs\n========================================"
 	echo -e "========================================\nLogs\n========================================"
 }| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee "${scriptlogdir}/${servicename}-email.log" > /dev/null 2>&1
 }| sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee "${scriptlogdir}/${servicename}-email.log" > /dev/null 2>&1
 echo -e "\n\n	Script log\n===================" >> "${emaillog}"
 echo -e "\n\n	Script log\n===================" >> "${emaillog}"

+ 1 - 1
lgsm/functions/install_logs.sh

@@ -8,7 +8,7 @@ local modulename="Install"
 
 
 if [ "${checklogs}" != "1" ]; then
 if [ "${checklogs}" != "1" ]; then
 	echo ""
 	echo ""
-	echo "Creating log directorys"
+	echo "Creating log directories"
 	echo "================================="
 	echo "================================="
 fi
 fi
 sleep 1
 sleep 1

+ 1 - 1
lgsm/functions/install_ut2k4_key.sh

@@ -12,7 +12,7 @@ echo "================================="
 sleep 1
 sleep 1
 echo "To get your server listed on the Master Server list"
 echo "To get your server listed on the Master Server list"
 echo "you must get a free CD key. Get a key here:"
 echo "you must get a free CD key. Get a key here:"
-echo "http://www.unrealtournament.com/ut2004server/cdkey.php"
+echo "https://forums.unrealtournament.com/utserver/cdkey.php?2004"
 echo ""
 echo ""
 if [ -z "${autoinstall}" ]; then
 if [ -z "${autoinstall}" ]; then
 	echo "Once you have the key enter it below"
 	echo "Once you have the key enter it below"