Register for your free account! | Forgot your password?

You last visited: Today at 13:51

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Server Management Script

Discussion on [Release] Server Management Script within the Metin2 PServer Designs, Websites & Scripts forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
.Yacki's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 7,437
Received Thanks: 3,655
[Release] Server Management Script

Hallo liebe e*pvpler.

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:
Einbau
Okay, 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"
Ich denke da gibt es nicht viel zu sagen.. einfach euren Servernamen eingeben.

Weiter gehts:

Code:
PATHTOSF=/usr/home/game
Diese Variable gibt den Pfad zu euren Serverfiles an. Bei mir ist es /usr/home/game, was es bei euch ist, müsst ihr ja schließlich selber wissen und demnach eintragen.

Code:
AUTHDB=$PATHTOSF/yacki
Da kommt der Unterordner eurer Auth- & DB-Ordner hin. Nur das 'yacki' ändern in 'invoice' oder was auch immer.

Code:
sdir="cd $PATHTOSF && cd yacki"
Auch hier wieder 'yacki' zu 'invoice' oder was auch immer ändern.


Das Skript dem Server zufügen:

Quote:
cd PFADZUEURENSERVERFILES
Quote:
rm start.sh && ee start.sh
Dort fügt ihr (wenn ihr über PuTTy verbunden seid) das Skript ein per Rechtsklick aufs schwarze Feld.

Danach ESC und 2x Enter.
Quote:
chmod -R 777 start.sh
und fertig ist der Einbau.

Um die Datei direkt am Beginn der Session auszuführen, macht ihr Folgendes:
Code:
cd
(Leerzeichen beachten!)
Code:
ee .login
Dort tippt ihr jetzt am Ende der Datei, also in eine neue Zeile ein:

Quote:
sh /usr/home/game/start.sh
Pfad gemäß euren Serverfiles anpassen!

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
Viel Spaß damit.
Verbesserungsvorschläge nehme ich gerne per PN an, allerdings kann ich keinen Support betreiben.

Grüße,
Yacki.
.Yacki is offline  
Thanks
3 Users
Old 02/21/2014, 17:07   #2
 
elite*gold: 1
The Black Market: 127/0/0
Join Date: Dec 2013
Posts: 3,467
Received Thanks: 720
Kannst du bitte mal ein Bild Posten wie es aussieht ?
K.A.K.A.S.H.I is offline  
Old 02/21/2014, 17:15   #3
 
NaOiZ's Avatar
 
elite*gold: 0
Join Date: Jun 2011
Posts: 738
Received Thanks: 499


So schaut es aus

Danke für das
NaOiZ is offline  
Thanks
1 User
Old 02/21/2014, 17:16   #4
 
elite*gold: 0
Join Date: Sep 2013
Posts: 491
Received Thanks: 675
Code:
		sleep 2
		cd $AUTHDB/auth  && ./auth &
		sleep 2
		cd ./game99/core1 && ./game &
		sleep 2
		cd ./game99/core2 && ./game &
		sleep 2
		cd ./game99/core3 && ./game &
		sleep 2
		cd ./game99/core4 && ./game &
		sleep 2
		cd ./game99/core5 && ./game &
		sleep 2
Warum benutzt du da z.B. keine Schleife?
.Kibito is offline  
Thanks
1 User
Old 02/21/2014, 17:25   #5
 
elite*gold: 0
Join Date: May 2010
Posts: 563
Received Thanks: 90
was ist daran neu?
load01 is offline  
Old 02/21/2014, 17:28   #6
 
.Sanii's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 353
Received Thanks: 621
Quote:
Originally Posted by .Kibito View Post
Code:
		sleep 2
		cd $AUTHDB/auth  && ./auth &
		sleep 2
		cd ./game99/core1 && ./game &
		sleep 2
		cd ./game99/core2 && ./game &
		sleep 2
		cd ./game99/core3 && ./game &
		sleep 2
		cd ./game99/core4 && ./game &
		sleep 2
		cd ./game99/core5 && ./game &
		sleep 2
Warum benutzt du da z.B. keine Schleife?
Wollt grade sagen, ne schleife mit werten für Channelanzal und Coreanzahl wäre viel Eleganter und besser anzupassen für jeden
.Sanii is offline  
Thanks
1 User
Old 02/22/2014, 12:41   #7
 
.Yacki's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 7,437
Received Thanks: 3,655
Habe das Skript überarbeitet, sollte jetzt etwas kürzer sein, wobei die paar Bytes keine Rolle spielen..
.Yacki is offline  
Reply


Similar Threads Similar Threads
[RELEASE]IP-ban management script + new reg page
12/12/2013 - Dekaron Private Server - 30 Replies
So, this is the 1st version of the script that has been promised a while back! With this script, registration of banned IPs will be refused, and they won't be able to register! How to install Download MYSQL and install it. It is recommended that you download and use phpMyAdmin or NaviCat for MYSQL management, because it is nice to have a user interface. I prefer navicat, but I can't post the link of it, as warez is forbidden, but you can find it if you google ;) Download...



All times are GMT +2. The time now is 13:51.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.