Nabend Jungs,
ich habe mich mal wieder einige Stunden damit beschäftigt und etliche (alte) Beiträge zwecks autoupdatescript bei CSGO gefunden. So richtig schlau bin ich daraus leider nicht geworden. Wer hätte wohl Lust mir morgen Nachmittag etwas unter die Arme zu greifen diesbezüglich?
Danke schonmal!
Grüße,
dat mishu
[HILFE] CSGO Autoupdate script basteln und einbinden!
-
- 7.X
- mishu
- Erledigt
Aktuell führen wir noch einige Anpassungen durch, das Forum wurde jedoch bereits live geschaltet.
-
-
vieleicht hilft es dir
Server start "start.sh" file ->Code#! /bin/sh read -p "Enter your password: " -s pass gpg --passphrase $pass -d update_csgo_ds.txt.gpg 2>/dev/null | STEAMEXE=steamcmd ./steam.sh ; cd ./csgo_ds && screen -A -m -d -S csgo ./srcds_run -game csgo -autoupdate -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_all_maps +map cs_office pass="MegaPass"
Crypted "update_csgo_ds.txt.gpg" file -> -
Achja und wenn das nicht helfen sollte!
Versuche das malCode
Alles anzeigen#! /bin/bash ### BEGIN INIT INFO # Provides: csgo-server-launcher # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Counter-Strike - Global Offensive Server Launcher ### END INIT INFO ################################################################################## # # # Counter-Strike : Global Offensive Server Launcher v1.9 # # # # A simple script to launch your Counter-Strike : Global Offensive # # Dedicated Server. # # # # Copyright (C) 2013-2015 Cr@zy <webmaster@crazyws.fr> # # # # Counter-Strike : Global Offensive Server Launcher is free software; you can # # redistribute it and/or modify it under the terms of the GNU Lesser General # # Public License as published by the Free Software Foundation, either version 3 # # of the License, or (at your option) any later version. # # # # Counter-Strike : Global Offensive Server Launcher is distributed in the hope # # that it will be useful, but WITHOUT ANY WARRANTY; without even the implied # # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU Lesser General Public License for more details. # # # # You should have received a copy of the GNU Lesser General Public License # # along with this program. If not, see http://www.gnu.org/licenses/. # # # # Related post: http://goo.gl/HFFGy # # Usage: ./csgo-server-launcher.sh {start|stop|status|restart|console|update} # # - start: start the server # # - stop: stop the server # # - status: display the status of the server (down or up) # # - restart: restart the server # # - console: display the server console where you can enter commands. # # To exit the console without stopping the server, press CTRL + A then D. # # - update: update the server # # - create: creates a new server # # # ################################################################################## CONFIG_FILE="/etc/csgo-server-launcher/csgo-server-launcher.conf" # No edits necessary beyond this line function start { if [ ! -d $DIR_ROOT ]; then echo "ERROR: $DIR_ROOT is not a directory"; exit 1; fi if [ ! -x $DIR_ROOT/$DAEMON_GAME ]; then echo "ERROR: $DIR_ROOT/$DAEMON_GAME does not exist or is not executable"; exit 1; fi if status; then echo "$SCREEN_NAME is already running"; exit 1; fi # Create runscript file for autoupdate echo "Create runscript file '$STEAM_RUNSCRIPT' for autoupdate..." cd $DIR_STEAMCMD echo "login $STEAM_LOGIN $STEAM_PASSWORD" > $STEAM_RUNSCRIPT echo "force_install_dir $DIR_ROOT" >> $STEAM_RUNSCRIPT echo "app_update 740" >> $STEAM_RUNSCRIPT echo "quit" >> $STEAM_RUNSCRIPT chown $USER $STEAM_RUNSCRIPT chmod 600 $STEAM_RUNSCRIPT # Generated misc args GENERATED_ARGS=""; if [ -z "${API_AUTHORIZATION_KEY}" -a -f $DIR_GAME/webapi_authkey.txt ]; then API_AUTHORIZATION_KEY="`cat $DIR_GAME/webapi_authkey.txt`"; fi if [ ! -z "${API_AUTHORIZATION_KEY}" ] then GENERATED_ARGS="-authkey ${API_AUTHORIZATION_KEY}" if [ ! -z "${WORKSHOP_COLLECTION_ID}" ]; then GENERATED_ARGS="${GENERATED_ARGS} +host_workshop_collection ${WORKSHOP_COLLECTION_ID}"; fi if [ ! -z "${WORKSHOP_START_MAP}" ]; then GENERATED_ARGS="${GENERATED_ARGS} +workshop_start_map ${WORKSHOP_START_MAP}"; fi fi # Start game PARAM_START="${PARAM_START} ${GENERATED_ARGS}" echo "Start command : $PARAM_START" if [ `whoami` = root ] then su - $USER -c "cd $DIR_ROOT ; screen -AmdS $SCREEN_NAME ./$DAEMON_GAME $PARAM_START" else cd $DIR_ROOT screen -AmdS $SCREEN_NAME ./$DAEMON_GAME $PARAM_START fi } function stop { if ! status; then echo "$SCREEN_NAME could not be found. Probably not running."; exit 1; fi if [ `whoami` = root ] then tmp=$(su - $USER -c "screen -ls" | awk -F . "/\.$SCREEN_NAME\t/ {print $1}" | awk '{print $1}') su - $USER -c "screen -r $tmp -X quit" else screen -r $(screen -ls | awk -F . "/\.$SCREEN_NAME\t/ {print $1}" | awk '{print $1}') -X quit fi } function status { if [ `whoami` = root ] then su - $USER -c "screen -ls" | grep [.]$SCREEN_NAME@@b1dcfefab724de4e5eb0df9b34501e13ef7e9153@@ > /dev/null else screen -ls | grep [.]$SCREEN_NAME@@8bbf0f6172e42c890f4c403757e312cf1339e6ad@@ > /dev/null fi } function console { if ! status; then echo "$SCREEN_NAME could not be found. Probably not running."; exit 1; fi if [ `whoami` = root ] then tmp=$(su - $USER -c "screen -ls" | awk -F . "/\.$SCREEN_NAME\t/ {print $1}" | awk '{print $1}') su - $USER -c "screen -r $tmp" else screen -r $(screen -ls | awk -F . "/\.$SCREEN_NAME\t/ {print $1}" | awk '{print $1}') fi } function update { # Create the log directory if [ ! -d $DIR_LOGS ]; then echo "$DIR_LOGS does not exist, creating..." if [ `whoami` = root ] then su - $USER -c "mkdir -p $DIR_LOGS"; else mkdir -p "$DIR_LOGS" fi fi if [ ! -d $DIR_LOGS ] then echo "ERROR: Could not create $DIR_LOGS" exit 1 fi # Create the game root if [ ! -d $DIR_ROOT ] then echo "$DIR_ROOT does not exist, creating..." if [ `whoami` = root ] then su - $USER -c "mkdir -p $DIR_ROOT"; else mkdir -p "$DIR_ROOT" fi fi if [ ! -d $DIR_ROOT ] then echo "ERROR: Could not create $DIR_ROOT" exit 1 fi if [ -z "$1" ]; then retry=0; else retry=$1; fi if [ -z "$2" ] then if status then stop echo "Stop $SCREEN_NAME before update..." sleep 5 relaunch=1 else relaunch=0 fi else relaunch=$2 fi # Save motd.txt before update if [ -f "$DIR_GAME/motd.txt" ]; then cp $DIR_GAME/motd.txt $DIR_GAME/motd.txt.bck; fi echo "Starting the $SCREEN_NAME update..." if [ `whoami` = root ] then su - $USER -c "cd $DIR_STEAMCMD ; ./steamcmd.sh $PARAM_UPDATE 2>&1 | tee $UPDATE_LOG" else cd $DIR_STEAMCMD ./steamcmd.sh $PARAM_UPDATE 2>&1 | tee $UPDATE_LOG fi # Restore motd.txt if [ -f "$DIR_GAME/motd.txt.bck" ]; then mv $DIR_GAME/motd.txt.bck $DIR_GAME/motd.txt; fi # Check for update if [ `egrep -ic "Success! App '740' fully installed." "$UPDATE_LOG"` -gt 0 ] || [ `egrep -ic "Success! App '740' already up to date" "$UPDATE_LOG"` -gt 0 ] then echo "$SCREEN_NAME updated successfully" else if [ $retry -lt $UPDATE_RETRY ] then retry=`expr $retry + 1` echo "$SCREEN_NAME update failed... retry $retry/3..." update $retry $relaunch else echo "$SCREEN_NAME update failed... exit..." exit 1 fi fi # Send e-mail if [ ! -z "$UPDATE_EMAIL" ]; then cat $UPDATE_LOG | mail -s "$SCREEN_NAME update for $(hostname -f)" $UPDATE_EMAIL; fi if [ $relaunch = 1 ] then echo "Restart $SCREEN_NAME..." start sleep 5 echo "$SCREEN_NAME restarted successfully" else exit 1 fi } function create { # IP should never exist: RFC 5735 TEST-NET-2 if [ "$IP" = "198.51.100.0" ] then echo "ERROR: You must configure the script before you create a server." exit 1 fi # If steamcmd already exists just install the server if [ -e "$DIR_STEAMCMD/steamcmd.sh" ] then echo "steamcmd already exists..." echo "Installing/Updating $SCREEN_NAME" update return fi # Install steamcmd in the specified directory if [ ! -d "$DIR_STEAMCMD" ] then echo "$DIR_STEAMCMD does not exist, creating..." if [ `whoami` = "root" ] then su - $USER -c "mkdir -p $DIR_STEAMCMD" else mkdir -p $DIR_STEAMCMD fi if [ ! -d "$DIR_STEAMCMD" ] then echo "ERROR: Could not create $DIR_STEAMCMD" exit 1 fi fi # Download steamcmd echo "Downloading steamcmd from http://media.steampowered.com/client/steamcmd_linux.tar.gz" if [ `whoami` = "root" ] then su - $USER -c "cd $DIR_STEAMCMD ; wget http://media.steampowered.com/client/steamcmd_linux.tar.gz" else cd $DIR_STEAMCMD ; wget http://media.steampowered.com/client/steamcmd_linux.tar.gz fi if [ "$?" -ne "0" ] then echo "ERROR: Unable to download steamcmd" exit 1 fi # Extract it echo "Extracting and removing the archive" if [ `whoami` = "root" ] then su - $USER -c "cd $DIR_STEAMCMD ; tar xzvf ./steamcmd_linux.tar.gz" su - $USER -c "cd $DIR_STEAMCMD ; rm ./steamcmd_linux.tar.gz" else cd $DIR_STEAMCMD ; tar xzvf ./steamcmd_linux.tar.gz cd $DIR_STEAMCMD ; rm ./steamcmd_linux.tar.gz fi # Did it install? if [ ! -e "$DIR_STEAMCMD/steamcmd.sh" ] then echo "ERROR: Failed to install steamcmd" exit 1 fi # Run steamcmd for the first time to update it, telling it to quit when it is done echo "Updating steamcmd" if [ `whoami` = "root" ] then su - $USER -c "echo quit | $DIR_STEAMCMD/steamcmd.sh" else echo quit | $DIR_STEAMCMD/steamcmd.sh fi # Done installing steamcmd, install the server echo "Done installing steamcmd. Installing the game" echo "This will take a while" update } function usage { echo "Usage: service csgo-server-launcher {start|stop|status|restart|console|update|create}" echo "On console, press CTRL+A then D to stop the screen without stopping the server." } ### BEGIN ### # Read config file if [ ! -f "$CONFIG_FILE" ] then echo "ERROR: Config file $CONFIG_FILE not found..." exit 1 else source "$CONFIG_FILE" fi # Check required packages PATH=/bin:/usr/bin:/sbin:/usr/sbin if [ ! -x `which awk` ]; then echo "ERROR: You need awk for this script (try apt-get install awk)"; exit 1; fi if [ ! -x `which screen` ]; then echo "ERROR: You need screen for this script (try apt-get install screen)"; exit 1; fi if [ ! -x `which wget` ]; then echo "ERROR: You need wget for this script (try apt-get install wget)"; exit 1; fi if [ ! -x `which tar` ]; then echo "ERROR: You need tar for this script (try apt-get install tar)"; exit 1; fi case "$1" in start) echo "Starting $SCREEN_NAME..." start sleep 5 echo "$SCREEN_NAME started successfully" ;; stop) echo "Stopping $SCREEN_NAME..." stop sleep 5 echo "$SCREEN_NAME stopped successfully" ;; restart) echo "Restarting $SCREEN_NAME..." status && stop sleep 5 start sleep 5 echo "$SCREEN_NAME restarted successfully" ;; status) if status then echo "$SCREEN_NAME is UP" else echo "$SCREEN_NAME is DOWN" fi ;; console) echo "Open console on $SCREEN_NAME..." console ;; update) echo "Updating $SCREEN_NAME..." update ;; create) echo "Creating $SCREEN_NAME..." create ;; *) usage exit 1 ;; esac exit 0
-
Hi, ich schließe mich mal an.
Ich bin dabei auch die csgo update funktion zu automartisieren. Ich gehe aber anders vor und habe eine txt erstellt mit dem inhalt:
Diese liegt im vom tekbase erstellten csgo_7765 verzeichniss und hat die rechte 777.Code//Kommentare sind in der Datei auch erlaubt login anonymous force_install_dir ./ app_update 740 validate //ohne Integritaetscheck //app_update 740 exit
Und habe einen Variable Namen erstellt welcher folgendes beinhaltet.
Wenn ich die Variable dazu schalte und mir die skript logs angucke stelle ich fest das Variable skript mit ausgeführt wird. In dem screenlog des servers wird auch das Variablle skript verstanden. Zumindest wird mir angezeicht das der server einen autoreastart macht wenn der server abstürzt.
Das ganze sieht so ausCodeServer will auto-restart if there is a crash. WARNING: Could not locate steam dir:./steamcmd, ignoring
Meine frage hierzu wie gebe ich den fad richtig an. Ein punkt und ein schrägstrich verweisen doch auf das (./) selbe verzeichnis in den das start skript ausgeführt wird also in "csgo_7765" . Doch die Console sagt WARNING: Could not locate steam dir. Auch -steam_dir ./steamcmd.sh bringt keine wirkung!
Vielen dank!
mfg domme -
Gibt es keinen hier der eine Lösung zu meinem Problem weiß ? Wenn dies gelöst ist könnten anderes es genau so machen wenn es gewünscht wird. Ich würde es von mir aus auch noch mal einfacher zusammen fassen für andere !
-
In wie weit automatisieren? Das man nicht mehr auf update klicken muss?
-
Ich möchte den user in tekbase die möglichkeit geben das er über den downloade button einmal ein update prozess auslösen kann. Zudem möchte ich noch das der user die möglichkeit geben das im tebkbase über den startwert das automatische update funktion aktiviert werden kann. Sodass der server bei einem neuen updaten selbständige updatet.
-
Aso okay naja hab da was... Müsste es nur umbauen usw da es angepasst an firma ist wegen brandingtexten usw
-
Genau sowas in der Art will ich auch basteln. Würde mir das aber auch gerne etwas selbst erarbeiten einfach damit ich verstehe was, wann und wieso dies so oder so sein sollte/muss. etc.
Wenn du nichts dagegen hast, GenXRoad, würde ich dich um Hilfe bitten. -
Wie das ist wegen komplett selbständigem update uha glaub das wird so nicht wirklich funktionieren, da du dann im startbefehl den absoluten pfad angeben musst im sinne von /home/kunde/server/csgo_1234/script.sh
Einzigst das man es anstupsen kann mittels update fals verfügbar bzw mittels einfachem radiobutton update aktivieren oder so im startbefehl
-
Wie wäre es mit einer steamcmd installation auf dem root an sich?
Könnte man da dann mit hilfe eines passenden scripts zuzüglich der StartparameterZitat-autoupdate -steam_dir XYZ -steamcmd_script XYZ
etwas 'zurechtbasteln'? -
Als privat kannst du das wohl machen aber als hoster musst du dann jedem kunden einen eigenen startbefehl geben mit den absoluten pfaden
-
Ja ich habs mal in bugracker geschrieben gehabt eine variable zu schaffen gspath z.B. Wo /home/kunde/server/spiel_1234 generiert wird den rest kann man dann ja selbst machen
-
Gute Idee!
Ich habe es halt so gelöst jetze:
im csgo installationsordner einen steamcmd ordner erstellt -> steamcmd darin installiert -> eine update-txt hinzugepackt -> startparameter gesetzt:Zitat
-steam_dir ../steamcmd -steamcmd_script ../steamcmd/update_csgo -autoupdate
Allerdings lief es erst, nachdem ich zuvor jeweils eimal steamcmd als entsprechender kunde gestartet hatte. Warum genau erschließt sich mir linux-vollnoob nicht, aber ich habs einfach mal probiert und es hat danach geklappt.