Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
- s=$t0'_username_'
- o=/dev/null
- g=/usr/games/
- d=$g$s$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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement