Changeset 14 for scripts/usr/local/bin/7dtd-kill.sh
- Timestamp:
- May 17, 2014, 6:01:31 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/bin/7dtd-kill.sh
r11 r14 1 1 #!/bin/bash 2 # Version 12 # Version 3 3 3 4 4 # Tries to stop the 7dtd instance given as first parameter. … … 12 12 checkRootLoadConf 13 13 14 checkInstance $114 checkInstanceValid $1 15 15 16 16 res=$(isRunning $1) 17 17 if [ $res -eq 1 ]; then 18 telnetCommand $1 shutdown 19 sleep 1 20 res=$(isRunning $1) 21 if [ $res -eq 1 ]; then 18 echo "Trying to gracefully shutdown..." 19 tmp=$(telnetCommand $1 shutdown) 20 echo "Waiting for server to shut down..." 21 22 waittime=0 23 maxwait=5 24 until [ $(isRunning $1) -eq 0 ] || [ $waittime -eq $maxwait ]; do 25 (( waittime++ )) 26 sleep 1 27 echo $waittime/$maxwait 28 done 29 30 if [ $(isRunning $1) -eq 1 ]; then 31 echo "Failed, force closing server..." 22 32 start-stop-daemon --stop --pidfile $(getInstancePath $1)/7dtd.pid 23 33 fi
Note:
See TracChangeset
for help on using the changeset viewer.