Da ich zeigen wollte, dass ich auch noch lebe, wollte ich dieses "wertlose" Skript releasen. Wer es braucht, soll es benutzen; wer nicht, der nicht! Und bitte nicht flamen, wir wollen doch alle keine Verwarnungen oder Ähnliches riskieren, oder?
Na dann.
Kommen wir zu den Funktionen:
- Server starten
- Server stoppen
- Syserr und Syslog-Remover (löscht die syserr & syslogs)
- Make.py Ausführassistent
- Reboot + return to console (Zur Konsole zurückkehren)
Letzteres existiert eher zu dem Zweck, dass man das ganze vom Start an aus macht. Wie ihr das macht erkläre ich euch gern:
EinbauOkay, also wenn ihr das Skript gelesen habt, werdet ihr merken, dass ich bei den Variablen bestimmte Pfade eingetragen habe, die ihr gemäß euren Serverfiles anpassen müsst. Fangen wir mit der ersten Variable an, die zu Ändern ist:
Code:
SERVERNAME="OS-World"
Weiter gehts:
Code:
PATHTOSF=/usr/home/game
Code:
AUTHDB=$PATHTOSF/yacki
Code:
sdir="cd $PATHTOSF && cd yacki"
Das Skript dem Server zufügen:
Quote:
cd PFADZUEURENSERVERFILES
Dort fügt ihr (wenn ihr über PuTTy verbunden seid) das Skript ein per Rechtsklick aufs schwarze Feld.Quote:
rm start.sh && ee start.sh
Danach ESC und 2x Enter.
und fertig ist der Einbau.Quote:
chmod -R 777 start.sh
Um die Datei direkt am Beginn der Session auszuführen, macht ihr Folgendes:
Code:
cd
Code:
ee .login
Pfad gemäß euren Serverfiles anpassen!Quote:
sh /usr/home/game/start.sh
Und per ESC und 2x Enter seid ihr wieder draußen.
So, zu guter Letzt, das Skript:
Code:
#!/bin/sh # Script: Start.sh # Script by Yacki -> www.elitepvpers.com # This script allows you to start your server with instant reruns, which means # that if the server goes offline, it instantly restarts himself every hour. # You can set the timer by your own, the variable 'time' defines the actual # time in seconds, which is used in the section 'Autostart Cores'. # Also included is another script of mine: The Syserr- and Syslogcleaner, which # is based on a quick script that doesn't even need to be configured again. # the only 2 variable you may have to change are the first and the second one # of the section 'Declaring some variables' - It's the fullname of the path # to your serverfiles. AUTHDB is understandable I think. Just enter the path # to the DB / AUTH folder, but only the main folder! Not /x/game/asd/db ! # As an example I put in mine, so you can see a preview of how it has to look # like. If you still have questions, you can ask me on www.elitepvpers.com! # Enough talked! Have fun while using this script! # Declaring some variables SERVERNAME="OS-World" PATHTOSF=/usr/home/game AUTHDB=$PATHTOSF/yacki CMD="sh start.sh" status=0 time=3600 sdir="cd $PATHTOSF && cd yacki" start1="./channel1.ys &" start2="./channel2.ys &" start3="./channel3.ys &" start4="./channel4.ys &" start99="./game99.ys &" startdb="./db.ys &" startauth="./auth.ys &" # Intro clear echo -e "\033[33m Brought to you by Yacki -> www.elitepvpers.com \n \n \033[37m" echo -e "\033[36m Welcome to the Server Control-Panel(SCP) of $SERVERNAME Choose between these valid options:\n" if [ -r $PATHTOSF/channel1/core1/pid ] then status=1 if [ -r $PATHTOSF/channel2/core1/pid ] then status=2 if [ -r $PATHTOSF/channel3/core1/pid ] then status=3 if [ -r $PATHTOSF/channel4/core1/pid ] then status=4 fi fi fi fi echo -e "\033[32m(Currently running: $status channel(s)\033[36m (1) Start CHANNEL 1 (2) Start CHANNEL 1 + 2 (3) Start CHANNEL 1 + 2 + 3 (4) Start CHANNEL 1 + 2 + 3 + 4 (5) Clear all Syslog and Syserr Files (6) Stop the server (7) Return to console (8) Reboot (9) Make.py \033[37m" # Script read channel if [ "$channel" = '1' ] then cd $AUTHDB/db && ./db & sleep 2 cd $AUTHDB/auth && ./auth & sleep 2 cd ./game99/core*/ && ./game & sleep 2 cd ./channel1/core*/ && ./game & sleep 2 cd $PATHTOSF clear && echo -e "\033[32m Channel 1 started successfully! \033[37m" sleep 3 ./start.sh else if [ "$channel" = '2' ] then cd $AUTHDB/db && ./db & sleep 2 cd $AUTHDB/auth && ./auth & sleep 2 cd ./game99/core*/ && ./game & sleep 2 cd ./channel1/core*/ && ./game & sleep 2 cd ./channel2/core*/ && ./game & sleep 2 cd $PATHTOSF clear && echo -e "\033[32m Channel 1 + 2 started successfully! \033[37m" sleep 3 ./start.sh else if [ "$channel" = '3' ] then cd $AUTHDB/db && ./db & sleep 2 cd $AUTHDB/auth && ./auth & sleep 2 cd ./game99/core*/ && ./game & sleep 2 cd ./channel1/core*/ && ./game & sleep 2 cd ./channel2/core*/ && ./game & sleep 2 cd ./channel3/core*/ && ./game & sleep 2 cd $PATHTOSF clear && echo -e "\033[32m Channel 1 + 2 + 3 started successfully! \033[37m" sleep 3 ./start.sh else if [ "$channel" = '4' ] then cd $AUTHDB/db && ./db & sleep 2 cd $AUTHDB/auth && ./auth & sleep 2 cd ./game99/core*/ && ./game & sleep 2 cd ./channel1/core*/ && ./game & sleep 2 cd ./channel2/core*/ && ./game & sleep 2 cd ./channel3/core*/ && ./game & sleep 2 cd ./channel4/core*/ && ./game & sleep 2 cd $PATHTOSF clear && echo -e "\033[32m Channel 1 + 2 + 3 + 4 started successfully! \033[37m" sleep 3 ./start.sh else if [ "$channel" = '5' ] then cd $PATHTOSF/channel*/core*/ && rm syserr && touch syserr cd $PATHTOSF/game99/core*/ && rm syserr && touch syserr cd $AUTHDB/auth && rm syserr && touch syserr cd $AUTHDB/db && rm syserr && touch syserr cd $PATHTOSF/channel*/core*/ && rm syslog && touch syslog cd $PATHTOSF/game99/core* && rm syslog && touch syslog cd $AUTHDB/auth && rm syslog && touch syslog cd $AUTHDB/db && rm syslog && touch syslog clear && echo -e "\033[32m Both syserr and syslog were deleted successfully!\033[37m" sleep 3 cd $PATHTOSF && ./start.sh else if [ "$channel" = '6' ] then while [ -r $PATHTOSF/channel1/core1/pid > 0 ] do cd $AUTHDB/db && ./shut.sh & cd ./channel*/core* && ./shut.sh & cd ./game99/core*/ && ./shut.sh & cd $AUTHDB/auth && ./shut.sh & cd $PATHTOSF && sleep 1 done clear && echo -e "\033[32m Server was shut down successfully!\033[37m" sleep 3 ./start.sh else if [ "$channel" = '7' ] then exit else if [ "$channel" = '8' ] then reboot else if [ "$channel" = '9' ] then cd $PATHTOSF/share/locale/germany/quest && python make.py && sleep 5 clear && echo -e "\033[32m All quests were extracted to 'object'! \n /reload q Ingame will activate them.\n A reboot will also do it.\033[37m" && sleep 5 && cd $PATHTOSF && ./start.sh else if [ "$channel" != '' ] then clear && echo -e "\033[31m $channel is not a valid input! \033[37m" sleep 3 ./start.sh else clear && echo -e "\033[31m Please choose between 1-9! \033[37m" sleep 3 ./start.sh fi fi fi fi fi fi fi fi fi fi
Verbesserungsvorschläge nehme ich gerne per PN an, allerdings kann ich keinen Support betreiben.
Grüße,
Yacki.