iw.sh (
Server connectivity checker, requires NetCat to be installed.)
#!/bin/bash -e
a=awk
n=nc
g=grep
e=echo
c=cat
o=/root/on.out
s="CS2D server(s) are "
d="down."
r="running."
if [ -z "$1" ]; then
	p=1337
else
	p=$1
fi
$n -kvzuw 1 localhost $p 1&> $o
# $c $o | $a '{print $5}' < $o
if [ "$($g 'open' $o)" ]; then
	$e "$s$r - $?"
else
	$e "$s$d - $?"
fi
gserv.sh (
Required to automate running/terminating servers.)
#!/bin/bash
t0='cs2d'
t1='The game server'
t2='create'
t3='terminate'
t4='_dedicated'
t5=' '$t2'd'
t6=' '$t3'd'
t7='with corresponding pattern "'
t8=' has been'
t9='Invalid input arguments. [Error Code: '
t10=$t1'(s) '$t7
o=/dev/null
g=/home/
d=$g$2/
e=echo
k=kill
if [ "$1" == "$t2" ] && [ -n "$2" ]; then
	if [ -d "$d" ]; then
		nohup $d$t0$t4 > $o 2>&1 &
		$e $t1$t8$t5.
	elif [ ! -d "$d" ]; then
		$e "Directory \"$2\" does not exist!"
	else
		$e $t9"3]"
	fi
elif [ "$1" == "$t3" ] && [ -n "$2" ] || [ -n "$3" ]; then
	if [ "$3" == "match" ] || [ "$3" == "name" ]; then
		p$k -f $2/$t0$t4
		$e $t10$2\"$t8$t6.
	elif [ "$3" == "all" ] || [ "$3" == "any" ]; then
		$k -p -s 9 `pidof $t0$t4`
		$e $t10$t0$t4\"$t8$t6.
	else
		$e $t9"2]"
	fi
else
	$e $t9"1]"
fi