source: scripts/usr/local/bin/7dtd-kill.sh@ 13

Last change on this file since 13 was 11, checked in by alloc, 11 years ago

Fix for instances/kill

  • Property svn:executable set to *
File size: 566 bytes
Line 
1#!/bin/bash
2# Version 1
3
4# Tries to stop the 7dtd instance given as first parameter.
5# Returns:
6# 0 : Done
7# 1 : Was not running
8# 2 : No instance name given
9# 3 : No such instance
10
11. /usr/local/bin/7dtd-common.sh
12checkRootLoadConf
13
14checkInstance $1
15
16res=$(isRunning $1)
17if [ $res -eq 1 ]; then
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
24 rm $(getInstancePath $1)/7dtd.pid
25 echo "Done"
26 exit 0
27else
28 echo "7dtd instance $1 is NOT running"
29 exit 1
30fi
Note: See TracBrowser for help on using the repository browser.