Changeset 14 for scripts/usr/local/bin/7dtd-instances.sh
- Timestamp:
- May 17, 2014, 6:01:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/bin/7dtd-instances.sh
r13 r14 1 1 #!/bin/bash 2 # Version 22 # Version 3 3 3 4 4 # Lists available 7dtd instances. … … 13 13 printf -v line "%*s-+-%*s-+-%*s-+-%*s\n" 20 " " 8 " " 7 " " 5 " " 14 14 echo ${line// /-} 15 for I in $SDTD_BASE/instances/*; do 16 ins=`basename $I` 17 run=$(isRunning $ins) 15 for I in $(getInstanceList); do 16 run=$(isRunning $I) 18 17 if [ $run -eq 1 ]; then 19 18 run="yes" 20 tel=$(telnetCommand $ inslp)19 tel=$(telnetCommand $I lp) 21 20 cur=`echo $tel | sed "s/\r/\n/g" | sed "s/^ //g" | grep "Total of " | cut -d\ -f 3` 22 21 else 23 22 run="no" 24 cur= 023 cur="-" 25 24 fi 26 25 27 max=$(getConfigValue $ insServerMaxPlayerCount)28 port=$(getConfigValue $ insServerPort)26 max=$(getConfigValue $I ServerMaxPlayerCount) 27 port=$(getConfigValue $I ServerPort) 29 28 30 printf "%-*s | %*s | %2 d/%2d | %5d\n" 20 "$ins" 8 "$run" $cur $max $port29 printf "%-*s | %*s | %2s/%2d | %5d\n" 20 "$I" 8 "$run" $cur $max $port 31 30 done 32 31 exit 0 … … 34 33 35 34 showInfo() { 36 if [ -z $1 ]; then 37 echo "Missing parameter <instance>" 38 exit 1 39 fi 40 checkInstance $1 35 checkInstanceValid $1 41 36 42 37 line() {
Note:
See TracChangeset
for help on using the changeset viewer.