Quellcode |
|
1 2 |
root@steam:/home/steam/start-scripte# ./one-war.sh start Start oneWAR-hl2 |
Quellcode |
|
1 2 3 |
root@steam:/home/steam/start-scripte# /etc/init.d/HL2-MASTER root@steam:/home/steam/start-scripte# one-war.sh: 16: one-war.sh: function: not found one-war.sh: 45: one-war.sh: Syntax error: "}" unexpected |
Quellcode |
|
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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
#!/bin/bash LOW_USER="steam" DIR="/home/steam/games/hl2/one-war" # Absolute dir to the CS:S server DEAMON="srcds_run" # Deamon to open; normaly not to change IP="94.23.164.136" # IP of you server PORT="27045" # Default port of the CS:S Server is 27015 PARAMS="-game hl2mp -ip $IP -port $PORT" # Deamon Parameters PARAMS2="+map dm_lockdown +maxplayers 16 +tv_port 27046 +clientport 27047" # Deamon Parameters SCREENNAME="oneWAR-hl2" # A unique name for the screen instance of the server function init { if [ -z "$DIR" ]; then echo "Please fill out the DIR variable." exit 0 fi if [ -z "$DEAMON" ]; then echo "Please fill out the DEAMON variable." exit 0 fi if [ -z "$PARAMS" ]; then echo "Please fill out the PARAMS variable." exit 0 fi if [ -z "$PARAMS2" ]; then echo "Please fill out the PARAMS2 variable." exit 0 fi if [ -z "$SCREENNAME" ]; then echo "Please fill out the SCREENNAME variable." exit 0 fi if [ -z "$IP" ]; then echo "Please fill out the IP variable." exit 0 fi if [ -z "$PORT" ]; then echo "Please fill out the PORT variable." exit 0 fi } function start_server { if [[ `su - $LOW_USER -c "screen -ls | grep $SCREENNAME"` ]]; then echo "The server runs already as screen instance $SCREENNAME" else echo "Start $SCREENNAME" if [ -d "$DIR" ]; then cd "$DIR" su - $LOW_USER -c "screen -d -m -S $SCREENNAME $DIR/$DEAMON $PARAMS $PARAMS2" else echo "Please fill out the DIR variable" fi fi } function stop_server { if [[ `screen -ls | grep $SCREENNAME` ]]; then echo -n "Sop $SCREENNAME" kill `screen -ls | grep $SCREENNAME | awk -F . '{print $1}'| awk '{print $1}'` echo " ...done" else echo "Can not find the screen instance $SCREENNAME" fi } function update_server { echo "Ausgebaut Sry" } function wrong_input { echo "Usage: $0 {start|stop|restart|update|console|check}" exit 1 } function get_screen { screen -r $SCREENNAME } function check_ping { if [ "`/usr/bin/quakestat -a2s $IP:$PORT | grep -v ADDRESS | awk '{ print $2 }' | awk -F/ ' { print $1}'`" = "DOWN" ]; then sleep 10 if [ "`/usr/bin/quakestat -a2s $IP:$PORT | grep -v ADDRESS | awk '{ print $2 }' | awk -F/ ' { print $1}'`" = "DOWN" ]; then stop_server start_server fi fi } init case "$1" in start) start_server ;; stop) stop_server ;; restart) stop_server start_server ;; update) update_server ;; console) get_screen ;; check) check_ping ;; *) wrong_input ;; esac exit 0 |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 |
#!/bin/bash #sh enno001.sh start & #sh jump.sh start & sh /home/steam/start-scripte/one-war.sh start & #sh rel-pms.sh start & #sh zeibig-fun.sh start & exit 1 |
Benutzerinformationen überspringen
Super Moderator
Wohnort: Mönchengladbach
Beruf: Brückenkranführer / Staplerfahrer
Rootserver vorhanden: Nein
Benutzerinformationen überspringen
Administrator
Wohnort: Hagen
Beruf: Mechatroniker (didaktische Systeme)
Rootserver vorhanden: Nein