source: scripts/usr/local/bin/7dtd-running.sh@ 9

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

Fix #1, #2, #3, #5; Refs #4, #6: WD works for save path, not for some logs

  • Property svn:executable set to *
File size: 502 bytes
Line 
1#!/bin/bash
2# Checks if the 7dtd instance given as first parameter is running.
3# Returns:
4# 0 : Running
5# 1 : Not running
6# 2 : No instance name given
7# 3 : No such instance
8
9. /usr/local/bin/7dtd-common.sh
10checkRootLoadConf
11
12checkInstance $1
13
14res=$(isRunning $1)
15if [ $res -eq 1 ]; then
16 echo "7dtd instance $1 is running"
17 echo "Open ports:"
18 netstat -nlp | grep 15161 | sed -r 's/^.*[^ :]*:([^ ]*).*[^ :]*:[^ ]*.*/ \1/g' | sort
19 exit 0
20else
21 echo "7dtd instance $1 is NOT running"
22 exit 1
23fi
Note: See TracBrowser for help on using the repository browser.