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

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

More instance validation, switch to XMLStarlet, config.xml instead of serverconfig.xml, admins.xml instead of serveradmin.xml

  • Property svn:executable set to *
File size: 520 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
16res=$(isRunning $1)
17if [ $res -eq 1 ]; then
18 echo "7dtd instance $1 is running"
19 echo "Open ports:"
20 netstat -nlp | grep 15161 | sed -r 's/^.*[^ :]*:([^ ]*).*[^ :]*:[^ ]*.*/ \1/g' | sort
21 exit 0
22else
23 echo "7dtd instance $1 is NOT running"
24 exit 1
25fi
Note: See TracBrowser for help on using the repository browser.