Răsfoiți Sursa

corrected then statements not matching

Daniel Gibbs 10 ani în urmă
părinte
comite
553ece636f
4 a modificat fișierele cu 27 adăugiri și 27 ștergeri
  1. 17 17
      functions/fn_deps_detect
  2. 4 4
      functions/fn_start
  3. 4 4
      functions/fn_stop
  4. 2 2
      functions/fn_update_check

+ 17 - 17
functions/fn_deps_detect

@@ -2,7 +2,7 @@
 # LGSM fn_dep_detect function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-lgsm_version="061115"
+lgsm_version="201215"
 
 # Description: Detects dependencies the server binary requires.
 
@@ -10,17 +10,17 @@ local modulename="Backup"
 fn_check_root
 fn_check_systemdir
 cd "${executabledir}"
-if [ "${executable}" ==  "./hlds_run" ];then
+if [ "${executable}" ==  "./hlds_run" ]; then
 	executable=hlds_linux
-elif [ "${executable}" ==  "./srcds_run" ]||[ "${executable}" ==  "./dabds.sh" ]||[ "${executable}" ==  "./srcds_run.sh" ];then
+elif [ "${executable}" ==  "./srcds_run" ]||[ "${executable}" ==  "./dabds.sh" ]||[ "${executable}" ==  "./srcds_run.sh" ]; then
 	executable=srcds_linux
-elif [ "${executable}" ==  "./server_linux32" ];then
+elif [ "${executable}" ==  "./server_linux32" ]; then
 	executable=libSpark_Core.so
-elif [ "${executable}" ==  "./runSam3_DedicatedServer.sh" ];then
+elif [ "${executable}" ==  "./runSam3_DedicatedServer.sh" ]; then
 	executable=Sam3_DedicatedServer
-elif [ "${executable}" ==  "./7DaysToDie.sh" ];then
+elif [ "${executable}" ==  "./7DaysToDie.sh" ]; then
 	executable=7DaysToDie.x86
-elif [ "${executable}" ==  "./ucc-bin" ];then
+elif [ "${executable}" ==  "./ucc-bin" ]; then
         
 	if [ -f "${executabledir}/ucc-bin-real" ]; then
 		executable=ucc-bin-real
@@ -30,7 +30,7 @@ elif [ "${executable}" ==  "./ucc-bin" ];then
 		executable=ut-bin
 	fi
 
-elif [ "${executable}" ==  "./ts3server_startscript.sh" ];then
+elif [ "${executable}" ==  "./ts3server_startscript.sh" ]; then
 	executable=ts3server_linux_amd64	
 fi
 
@@ -48,37 +48,37 @@ echo "apt-get install " > "${rootdir}/.depdetect_ubuntu_list_uniq"
 echo "apt-get install " > "${rootdir}/.depdetect_debian_list_uniq"
 while read lib; do
 	sharedlib=${lib}
-	if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ];then
+	if [ "${lib}" == "libm.so.6" ]||[ "${lib}" == "libc.so.6" ]||[ "${lib}" == "libpthread.so.0" ]||[ "${lib}" == "libdl.so.2" ]||[ "${lib}" == "libnsl.so.1" ]||[ "${lib}" == "libgcc_s.so.1" ]||[ "${lib}" == "librt.so.1" ]||[ "${lib}" == "ld-linux.so.2" ]; then
 		echo "glibc.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "lib32gcc1" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "lib32gcc1" >> "${rootdir}/.depdetect_debian_list"
 	
-	elif [ "${lib}" == "libstdc++.so.6" ];then
+	elif [ "${lib}" == "libstdc++.so.6" ]; then
 		echo "libstdc++.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "libstdc++6:i386" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "libstdc++6:i386" >> "${rootdir}/.depdetect_debian_list"
 	
-	elif [ "${lib}" == "libstdc++.so.5" ];then
+	elif [ "${lib}" == "libstdc++.so.5" ]; then
 		echo "compat-libstdc++-33.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "libstdc++5:i386" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "libstdc++5:i386" >> "${rootdir}/.depdetect_debian_list"
 
-	elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ];then 
+	elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then 
 		echo "speex.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "speex:i386" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "speex:i386" >> "${rootdir}/.depdetect_debian_list"
 
-	elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ];then 
+	elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then 
 		echo "SDL.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "libsdl1.2debian" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "libsdl1.2debian" >> "${rootdir}/.depdetect_debian_list"		
 
-	elif [ "${lib}" == "libtbb.so.2" ];then 
+	elif [ "${lib}" == "libtbb.so.2" ]; then 
 		echo "tbb.i686" >> "${rootdir}/.depdetect_centos_list"
 		echo "libtbb2" >> "${rootdir}/.depdetect_ubuntu_list"
 		echo "libtbb2" >> "${rootdir}/.depdetect_debian_list"
 
-	elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ];then
+	elif [ "${lib}" == "libtier0.so" ]||[ "${lib}" == "Core.so" ]||[ "${lib}" == "Editor.so" ]||[ "${lib}" == "Engine.so" ]||[ "${lib}" == "liblua.so" ]||[ "${lib}" == "libsteam_api.so" ]||[ "${lib}" == "ld-linux-x86-64.so.2" ]||[ "${lib}" == "libPhysX3_x86.so" ]||[ "${lib}" == "libPhysX3Common_x86.so" ]||[ "${lib}" == "libPhysX3Cooking_x86.so" ]; then
 		# Known shared libs what dont requires dependencies
 		:
 	else
@@ -89,7 +89,7 @@ done < "${rootdir}/.depdetect_readelf"
 sort "${rootdir}/.depdetect_centos_list" | uniq >> "${rootdir}/.depdetect_centos_list_uniq"
 sort "${rootdir}/.depdetect_ubuntu_list" | uniq >> "${rootdir}/.depdetect_ubuntu_list_uniq"
 sort "${rootdir}/.depdetect_debian_list" | uniq >> "${rootdir}/.depdetect_debian_list_uniq"
-if [ "${unknownlib}" == "1" ];then
+if [ "${unknownlib}" == "1" ]; then
 	sort "${rootdir}/.depdetect_unknown" | uniq >> "${rootdir}/.depdetect_unknown_uniq"
 fi
 
@@ -116,7 +116,7 @@ echo "Debian"
 echo "================================="
 cat "${rootdir}/.depdetect_debian_line"
 echo ""
-if [ "${unknownlib}" == "1" ];then
+if [ "${unknownlib}" == "1" ]; then
 	echo ""
 	echo "Unknown shared Library"
 	echo "================================="

+ 4 - 4
functions/fn_start

@@ -2,7 +2,7 @@
 # LGSM fn_start function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-lgsm_version="061115"
+lgsm_version="201215"
 
 # Description: Starts the server.
 
@@ -59,7 +59,7 @@ cd "${executabledir}"
 ./ts3server_startscript.sh start inifile="${servercfgfullpath}" > /dev/null 2>&1
 sleep 1
 fn_check_ts3status
-if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}"	= "No server running (ts3server.pid is missing)" ];then
+if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}"	= "No server running (ts3server.pid is missing)" ]; then
 	fn_printfailnl "Unable to start ${servername}"
 	fn_scriptlog "Unable to start ${servername}"
 	echo -e "	Check log files: ${rootdir}/log"
@@ -163,11 +163,11 @@ if [ "${tmuxwc}" -eq 0 ]; then
 		cat "${scriptlogdir}/.${servicename}-tmux-error.tmp" >> "${scriptlog}"
 
 		# Detected error http://gameservermanagers.com/issues
-		if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ];then
+		if [ $(grep -c "Operation not permitted" "${scriptlogdir}/.${servicename}-tmux-error.tmp") ]; then
 		echo ""
 		echo "Fix"
 		echo "================================="
-			if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ];then
+			if [ ! $(grep "tty:" /etc/group|grep "$(whoami)") ]; then
 				echo "$(whoami) is not part of the tty group."
 				fn_scriptlog "$(whoami) is not part of the tty group."
 				group=$(grep tty /etc/group)

+ 4 - 4
functions/fn_stop

@@ -2,7 +2,7 @@
 # LGSM fn_stop function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-lgsm_version="061115"
+lgsm_version="201215"
 
 # Description: Stops the server.
 
@@ -35,7 +35,7 @@ fn_printdots "${servername}"
 fn_scriptlog "${servername}"
 sleep 1
 fn_check_ts3status
-if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ];then
+if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
     fn_printfail "${servername} is already stopped"
     fn_scriptlog "${servername} is already stopped"
 else
@@ -132,12 +132,12 @@ else
                 pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
                 sleep 1
                 let counter=counter+1
-                if [  "${counter}" -gt "1" ];then
+                if [  "${counter}" -gt "1" ]; then
                     fn_printdots "Attempting graceful shutdown: ${counter}"
                 fi    
             done
             pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -Ec "^${servicename}:")
-            if [ "${pid}" == "0" ];then
+            if [ "${pid}" == "0" ]; then
                 fn_printok "Attempting graceful shutdown"
             else
                 fn_printfail "Attempting graceful shutdown"

+ 2 - 2
functions/fn_update_check

@@ -2,7 +2,7 @@
 # LGSM fn_update_check function
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
-lgsm_version="061115"
+lgsm_version="201215"
 
 # Description: Checks if a server update is available.
 
@@ -276,7 +276,7 @@ if [ "${currentbuilddigit}" -ne "${availablebuilddigit}" ]; then
 	fn_scriptlog "Available build: ${availablebuild}"
 	fn_scriptlog "${currentbuild} > ${availablebuild}"
 	fn_check_ts3status
-	if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ];then
+	if [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
 		fn_update_dl
 		fn_start
 		sleep 5