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

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

Minor cleanups

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