Source code |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# !!!!!!!!!!!!!! CHANGE THIS TO THE USER YOU USE FOR YOUR SERVER !!!!!!!!!!!!!!! CS_USER=jump # You must be logged in as this user (not by su!) to re-attach the screen! PATH=/bin:/usr/bin:/sbin:/usr/sbin # # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS! DIR=/home/jump/srcds/orangebox DAEMON=srcds_run # Internet server: PARAMS="-game hl2mp +ip 94.23.17.164 -port 27045 +map jump_portal_b83 +maxplayers 16 +tv_port 27046 +clientport 27047 -autoupdate" NAME=jumpserver DESC="jump" start() { echo "Starting $DESC: $NAME" if [ -e $DIR ] then if [ `whoami` = root ] then su - $CS_USER -c "cd $DIR ; screen -d -m -S $NAME ./$DAEMON $PARAMS" else cd $DIR ; screen -d -m -S $NAME ./$DAEMON $PARAMS fi echo " ... done." else echo "No such directory: $DIR!" fi } stop () { if [ `whoami` = root ] then if [[ `su $CS_USER -l -c "screen -ls" | grep [.]$NAME[[:space:]]` ]] then echo -n "Stopping $DESC: $NAME" kill $(su $CS_USER -l -c "screen -ls" | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') echo " ... done." else echo "$DESC $NAME could not be found. Probably not running." fi else if [[ `screen -ls | grep [.]$NAME[[:space:]]` ]] then echo -n "Stopping $DESC: $NAME" kill $(screen -ls | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') echo " ... done." else echo "$DESC $NAME could not be found. Probably not running." fi fi } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) if [ `whoami` = root ] then su - $CS_USER -c "screen -ls" | grep [.]$NAME[[:space:]] > /dev/null else screen -ls | grep [.]$NAME[[:space:]] > /dev/null fi CHECK=$? [ $CHECK -eq 0 ] && echo "$DESC: $NAME is UP" || echo "$DESC: $NAME is DOWN" ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit 0 |
This post has been edited 2 times, last edit by "Impact" (Feb 21st 2012, 5:59pm) with the following reason: Formatierung
This post has been edited 1 times, last edit by "Impact" (Feb 21st 2012, 6:05pm)
Ich habe dir die Formatierung mal behoben, die Grammatik ist aber auch fehlerhaft.
Dein Load ist sehr sehr hoch, ich habe die Erfahrung gemacht dass ein so hoher Load eher von i/o kommt.
Impact
Source code |
|
1 |
ionice -n 7 -c 3 nice -n +19 zip |