Hey, ich habe mal eine frage...
mein startscript:
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 | # !!!!!!!!!!!!!! CHANGE THIS TO THE USER YOU USE FOR YOUR SERVER !!!!!!!!!!!!!!! CS_USER=cssserveruser PATH=/bin:/usr/bin:/sbin:/usr/sbin # # DON'T FORGET TO CHANGE THE PATH TO YOUR NEEDS! DIR=/srcds DAEMON=srcds_run # LAN server: # PARAMS="-game cstrike -nomaster -insecure +sv_lan 1 +maxplayers 16 +map de_dust" # Internet server: PARAMS="-game cstrike +map de_dust +maxplayers 12 -port 27015" NAME=cssserver DESC="CS:S dedicated server" # No edits (should be) necessary beyond this line if [ ! -x `which awk` ]; then echo "You need awk for this script"; exit 1; fi if [ ! -x `which screen` ]; then echo "You need screen (the program, moron!) for this script"; exit 1; fi if [ `whoami` = root ] then usagetype=root else usagetype=nonroot fi start() { if [ ! -d $DIR ]; then echo " ... No such directory: $DIR!"; exit 1; fi if [ ! -x $DIR/$DAEMON ]; then echo "$DIR/$DAEMON does not exist or is not executable!"; exit 1; fi if status; then echo " ... $DESC: $NAME is already running!"; exit 1; fi case "$usagetype" in root) su - $CS_USER -c "cd $DIR ; screen -AmdS $NAME ./$DAEMON $PARAMS" ;; nonroot) cd $DIR ; screen -AmdS $NAME ./$DAEMON $PARAMS ;; esac } stop () { if ! status; then echo " ... $DESC $NAME could not be found. Probably not running."; exit 1; fi case "$usagetype" in root) tmp=$(su - $CS_USER -c "screen -ls" | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') su - $CS_USER -c "screen -r $tmp -X quit" ;; nonroot) screen -r $(screen -ls | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') -X quit ;; esac } status () { case "$usagetype" in root) su - $CS_USER -c "screen -ls" | grep [.]$NAME[[:space:]] > /dev/null ;; nonroot) screen -ls | grep [.]$NAME[[:space:]] > /dev/null ;; esac } watch () { if ! status; then echo "$DESC $NAME could not be found. Probably not running."; exit 1; fi case "$usagetype" in root) tmp=$(su - $CS_USER -c "screen -ls" | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') su - $CS_USER -c "screen -r $tmp" ;; nonroot) screen -r $(screen -ls | awk -F . "\$2 ~ /^$NAME[[:space:]].*/ {print \$1}" | awk '{print $1}') ;; esac } case "$1" in start) echo "Starting $DESC: $NAME" start echo " ... done." ;; stop) echo "Stopping $DESC: $NAME" stop echo " ... done." ;; restart) echo "Restarting $DESC: $NAME" status && stop start echo " ... done." ;; status) if status then echo "$DESC: $NAME is UP" else echo "$DESC: $NAME is DOWN" fi ;; watch) watch ;; *) echo "Usage: $0 {start|stop|status|restart|watch}\nWhile watching press ctrl-a, ctrl-d to stop watching without stopping the server." exit 1 ;; esac exit 0 |
ich würde das unter windows7 erstellen, weiß nur nicht wie... einfach mit notepad++ und dann unter welcher endung?
oder wie sonst? ☺
Dankr
Bearbeitet von Antiqua:
Bitte verwende in Zukunft für so etwas Codeblöcke, um die Übersicht im Forum zu verbessern. Danke!