소스 검색

Revert "Removed the need for files to be created with column"

This reverts commit 4a45f5d4bb159dd50a637f05f3b107359241e219.
Daniel Gibbs 10 년 전
부모
커밋
c7f07c56e2
1개의 변경된 파일76개의 추가작업 그리고 40개의 파일을 삭제
  1. 76 40
      functions/fn_details

+ 76 - 40
functions/fn_details

@@ -2,7 +2,7 @@
 # LGSM fn_details function
 # LGSM fn_details function
 # Author: Daniel Gibbs
 # Author: Daniel Gibbs
 # Website: http://gameservermanagers.com
 # Website: http://gameservermanagers.com
-# Version: 301015
+# Version: 281015
 
 
 # Description: Displays server infomation.
 # Description: Displays server infomation.
 
 
@@ -20,7 +20,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mHostname:\t\e[0m$HOSTNAME"
 	echo -e "\e[34mHostname:\t\e[0m$HOSTNAME"
 	echo -e "\e[34mtmux:\t\e[0m${tmuxv}"
 	echo -e "\e[34mtmux:\t\e[0m${tmuxv}"
 	echo -e "\e[34mGLIBC:\t\e[0m${glibcv}"
 	echo -e "\e[34mGLIBC:\t\e[0m${glibcv}"
-} | column -s $'\t' -t 
+} >> .fn_details_distro
+column -s $'\t' -t .fn_details_distro
+rm -f .fn_details_distro
 }
 }
 
 
 fn_details_performance(){
 fn_details_performance(){
@@ -30,13 +32,17 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 {
 {
 	echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m"
 	echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m"
 	echo -e "\e[34mAvg Load:\t\e[0m${load}"
 	echo -e "\e[34mAvg Load:\t\e[0m${load}"
-} | column -s $'\t' -t 
+} >> .fn_details_performance
+column -s $'\t' -t .fn_details_performance
+rm -f .fn_details_performance
 echo -e ""
 echo -e ""
 {
 {
 	echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m"
 	echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m"
 	echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m"
 	echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m"
 	echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m"
 	echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m"
-} | column -s $'\t' -t 
+} >> .fn_details_performance
+column -s $'\t' -t .fn_details_performance
+rm -f .fn_details_performance
 }
 }
 
 
 fn_details_disk(){
 fn_details_disk(){
@@ -52,7 +58,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	if [ -d "${backupdir}" ]; then
 	if [ -d "${backupdir}" ]; then
 		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
 		echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
 	fi
 	fi
-} | column -s $'\t' -t 
+} >> .fn_details_disk
+column -s $'\t' -t .fn_details_disk
+rm -f .fn_details_disk
 }
 }
 
 
 fn_details_gameserver(){
 fn_details_gameserver(){
@@ -124,7 +132,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	if [ -n "${dbplugin}" ]; then
 	if [ -n "${dbplugin}" ]; then
 		echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
 		echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
 	fi
 	fi
-} | column -s $'\t' -t 
+} >> .fn_details_gameserver
+column -s $'\t' -t .fn_details_gameserver
+rm -f .fn_details_gameserver
 echo -e ""
 echo -e ""
 
 
 ## script details
 ## script details
@@ -177,7 +187,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	if [ -n "${networkcfgfullpath}" ]; then
 	if [ -n "${networkcfgfullpath}" ]; then
 		echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
 		echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
 	fi
 	fi
-} | column -s $'\t' -t 
+} >> .fn_details_script
+column -s $'\t' -t .fn_details_script
+rm -f .fn_details_script
 }
 }
 
 
 fn_details_backup(){
 fn_details_backup(){
@@ -193,7 +205,9 @@ else
 		echo -e "\e[34m    date:\t\e[0m${lastbackupdate}"
 		echo -e "\e[34m    date:\t\e[0m${lastbackupdate}"
 		echo -e "\e[34m    file:\t\e[0m${lastbackup}"
 		echo -e "\e[34m    file:\t\e[0m${lastbackup}"
 		echo -e "\e[34m    size:\t\e[0m${lastbackupsize}"
 		echo -e "\e[34m    size:\t\e[0m${lastbackupsize}"
-	} | column -s $'\t' -t 
+	} >> .fn_details_backup
+	column -s $'\t' -t .fn_details_backup
+	rm -f .fn_details_backup
 fi
 fi
 }
 }
 
 
@@ -246,8 +260,9 @@ echo -e ""
 {
 {
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -273,8 +288,9 @@ echo -e ""
 {
 {
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -300,8 +316,9 @@ echo -e ""
 {
 {
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
-} | column -s $'\t' -t 
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -336,8 +353,9 @@ fi
 	echo -e "> Game\tINBOUND\t${port}\tudp"
 	echo -e "> Game\tINBOUND\t${port}\tudp"
 	echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
 	echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
-} | column -s $'\t' -t 
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -366,8 +384,9 @@ echo -e ""
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
 	echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-} | column -s $'\t' -t 
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -398,8 +417,9 @@ echo -e ""
 	        echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
 	        echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
 	fi
 	fi
 	echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
 	echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -429,7 +449,9 @@ echo -e ""
 	echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
 	echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
-} | column -s $'\t' -t
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 echo -e ""
 echo -e ""
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
@@ -437,8 +459,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html"
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html"
 	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
 	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -467,8 +490,9 @@ echo -e ""
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
 	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
 	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
 	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 
 
 }
 }
@@ -496,8 +520,9 @@ echo -e ""
 	echo -e "> Voice\tINBOUND\t${port}\tudp"
 	echo -e "> Voice\tINBOUND\t${port}\tudp"
 	echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
 	echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
 	echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
 	echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -524,8 +549,9 @@ echo -e ""
 {
 {
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -554,8 +580,9 @@ echo -e ""
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Game\tINBOUND\t${port}\ttcp"
 	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
 	echo -e "> Query\tINBOUND\t${queryport}\ttcp"
 	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
 	echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -586,7 +613,9 @@ echo -e ""
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
 	echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
 	echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
-} | column -s $'\t' -t
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 echo -e ""
 echo -e ""
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
@@ -594,7 +623,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
 	echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 echo -e ""
 echo -e ""
 echo -e "\e[92m${servername} Telnet\e[0m"
 echo -e "\e[92m${servername} Telnet\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
@@ -602,8 +633,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}"
 	echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}"
 	echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}"
 	echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}"
 	echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}"
 	echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -651,7 +683,9 @@ echo -e ""
 		fi
 		fi
 	fi
 	fi
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
 	echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
-} | column -s $'\t' -t
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 echo -e ""
 echo -e ""
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 echo -e "\e[92m${servername} WebAdmin\e[0m"
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
@@ -660,8 +694,9 @@ printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
 	echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
 	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
 	echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
 	echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
-} | column -s $'\t' -t
-
+} >> .fn_details_webadmin
+column -s $'\t' -t .fn_details_webadmin
+rm -f .fn_details_webadmin
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }
 
 
@@ -690,8 +725,9 @@ echo -e ""
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
 	echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
 	echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
 	echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
 	echo -e "> Query\tINBOUND\t${queryport}\tudp"
-} | column -s $'\t' -t
-
+} >> .fn_details_ports
+column -s $'\t' -t .fn_details_ports
+rm -f .fn_details_ports
 fn_details_statusbottom
 fn_details_statusbottom
 }
 }