|
@ -1,8 +1,12 @@ |
|
|
#!/usr/bin/env bash |
|
|
#!/usr/bin/env bash |
|
|
# |
|
|
# |
|
|
# Serververwaltung für STRAWBERRY-ROLEPLAY |
|
|
|
|
|
|
|
|
# Einfaches Start/Stopp/Restart Script |
|
|
# (C) 2021 by bithost GbR |
|
|
# (C) 2021 by bithost GbR |
|
|
# |
|
|
# |
|
|
|
|
|
### START CONFIG ### |
|
|
|
|
|
INSTANCE_NAME='fxserver' |
|
|
|
|
|
START_CMD='/home/fx-server/run.sh +set onesync on +set onesync_population false +exec server.cfg' |
|
|
|
|
|
### END CONFIG - DO NOT EDIT BELOW THIS MESSAGE!!! ### |
|
|
|
|
|
|
|
|
PS3='Was möchtest du machen? ' |
|
|
PS3='Was möchtest du machen? ' |
|
|
options=("Server starten" "Server stoppen" "Server neustarten" "Abbruch") |
|
|
options=("Server starten" "Server stoppen" "Server neustarten" "Abbruch") |
|
@ -11,38 +15,38 @@ do |
|
|
case $opt in |
|
|
case $opt in |
|
|
"Server starten") |
|
|
"Server starten") |
|
|
echo "Server wird gestartet..." |
|
|
echo "Server wird gestartet..." |
|
|
tmux new -n fxserver '/home/fx-server/run.sh +set onesync on +set onesync_population false +exec server.cfg' |
|
|
|
|
|
|
|
|
tmux new -n $INSTANCE_NAME $START_CMD |
|
|
break |
|
|
break |
|
|
;; |
|
|
;; |
|
|
"Server stoppen") |
|
|
"Server stoppen") |
|
|
echo "Server wird gestoppt" |
|
|
echo "Server wird gestoppt" |
|
|
tmux send-keys -t fxserver.0 'quit' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 'quit' ENTER |
|
|
break |
|
|
break |
|
|
;; |
|
|
;; |
|
|
"Server neustarten") |
|
|
"Server neustarten") |
|
|
echo "Server wird neugestartet" |
|
|
echo "Server wird neugestartet" |
|
|
tmux send-keys -t fxserver.0 say' [SRP] Automatischer Neustart in 180 Sekunden!' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 say' [SRP] Automatischer Neustart in 180 Sekunden!' ENTER |
|
|
sleep 120 |
|
|
sleep 120 |
|
|
tmux send-keys -t fxserver.0 say' [SRP] Automatischer Neustart in 60 Sekunden!' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 say' [SRP] Automatischer Neustart in 60 Sekunden!' ENTER |
|
|
sleep 40 |
|
|
sleep 40 |
|
|
tmux send-keys -t fxserver.0 say' [SRP] Automatischer Neustart in 30 Sekunden!' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 say' [SRP] Automatischer Neustart in 30 Sekunden!' ENTER |
|
|
sleep 20 |
|
|
sleep 20 |
|
|
|
|
|
|
|
|
COUNT=10 |
|
|
COUNT=10 |
|
|
while [ $COUNT -gt 0 ]; do |
|
|
while [ $COUNT -gt 0 ]; do |
|
|
tmux send-keys -t fxserver.0 say' [SRP] Automatischer Neustart in ' $COUNT ' Sekunden!' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 say' [SRP] Automatischer Neustart in ' $COUNT ' Sekunden!' ENTER |
|
|
let COUNT=COUNT-1 |
|
|
let COUNT=COUNT-1 |
|
|
sleep 1 |
|
|
sleep 1 |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
tmux send-keys -t fxserver.0 'quit' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 'quit' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t fxserver.0 '/home/fx-server/run.sh +set onesync on +set onesync_population false +exec server.cfg' ENTER |
|
|
|
|
|
|
|
|
tmux send-keys -t $INSTANCE_NAME.0 $START_CMD ENTER |
|
|
break |
|
|
break |
|
|
;; |
|
|
;; |
|
|
"Abbruch") |
|
|
"Abbruch") |
|
|
break |
|
|
break |
|
|
;; |
|
|
;; |
|
|
*) echo "Unbekannte Eingabe $REPLY";; |
|
|
|
|
|
|
|
|
*) echo "Unbekannte Eingabe: $REPLY";; |
|
|
esac |
|
|
esac |
|
|
done |
|
|
done |