Changeset 11


Ignore:
Timestamp:
May 15, 2014, 8:49:17 PM (5 years ago)
Author:
alloc
Message:

Fix for instances/kill

Location:
scripts/usr/local/bin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/bin/7dtd-instances.sh

    r10 r11  
    55# Returns:
    66#  0
     7
    78. /usr/local/bin/7dtd-common.sh
    89checkRootLoadConf
     
    1617        if [ $run -eq 1 ]; then
    1718                run="yes"
     19                tel=$(telnetCommand $ins lp)
     20                cur=`echo $tel | sed "s/\r/\n/g" | sed "s/^ //g" | grep "Total of " | cut -d\  -f 3`
    1821        else
    1922                run="no"
     23                cur=0
    2024        fi
    2125
    22         tel=$(telnetCommand $ins lp)
    2326        max=$(getConfigValue $ins ServerMaxPlayerCount)
    24         cur=`echo $tel | sed "s/\r/\n/g" | sed "s/^ //g" | grep "Total of " | cut -d\  -f 3`
    2527       
    2628        printf "%-*s | %*s |   %2d/%2d\n" 20 "$ins" 8 "$run" $cur $max
  • scripts/usr/local/bin/7dtd-kill.sh

    r10 r11  
    1616res=$(isRunning $1)
    1717if [ $res -eq 1 ]; then
    18         telnetCommand shutdown
    19         start-stop-daemon --stop --pidfile $(getInstancePath $1)/7dtd.pid
     18        telnetCommand $1 shutdown
     19        sleep 1
     20        res=$(isRunning $1)
     21        if [ $res -eq 1 ]; then
     22                start-stop-daemon --stop --pidfile $(getInstancePath $1)/7dtd.pid
     23        fi
    2024        rm $(getInstancePath $1)/7dtd.pid
    2125        echo "Done"     
Note: See TracChangeset for help on using the changeset viewer.