Rustide_2.0.bat

@ECHO OFF
:_LOOP

CLS

ECHO.
ECHO.
ECHO. =================================================
ECHO. = =
ECHO. = =
ECHO. = Rustide_V2 v2.00 by CyriLweB [LPM] =
ECHO. = =
ECHO. = This script auto updates Rust + Oxide Mod =
ECHO. = =
ECHO. = Updated 23 Dec 2017 =
ECHO. = =
ECHO. = Original author [Jarsky] =
ECHO. =================================================
ECHO.
ECHO.

REM :: SET YOUR SERVER SETTINGS HERE
REM :: YOU MUST CHANGE THE RCON PASSWORD

SET _hostname="Choisir un nom de serveur"
SET _ident="RUST"
SET _oxdir=server/RUST/oxide
SET _cfgfile=server\RUST\cfg\server.cfg
SET _port="28016"
SET _rport="28018"
SET _rcon="Choisir_un_mot_de_passe"
SET _players="125"
SET _level="Procedural Map"
SET _seed="4482"
SET _worldsize="3000"
SET _serverimg="https://exemple.com/Banner.jpg"
SET _serverurl="https://exemple.com"
SET _serverdesc="Ecrire une description du serveur, Utilisez \n pour une nouvelle ligne"

REM :: HERE ARE SOME MORE ADVANCED SETTINGS

SET _autostart=YES
SET _autorestart=NO
SET _autoupdate=YES
SET _forceupdate=YES
SET _savebackup=YES
SET _maxbackups=10
SET _backuploc=.\backups

REM :: DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOURE DOING

PING 127.0.0.1 -n 5 >NUL 2>&1 || PING ::1 -n 5 >NUL 2>&1

IF "%_rcon%"==""rust123"" (GOTO _RKILL)
IF "%_autoupdate%"=="NO" (
GOTO _BACKUP
) ELSE (
IF "%_forceupdate%"=="YES" (
GOTO _UPDATE
) ELSE (
GOTO _CHECK))

:_CHECK
REM ++Check if Process Running before updating++
TASKLIST /FI "IMAGENAME eq RustDedicated.exe" 2>NUL | FIND /I /N "RustDedicated.exe">NUL
IF "%ERRORLEVEL%"=="0" (
ECHO. ANOTHER RUST IS RUNNING - UPDATE SKIPPED. 
PING 127.0.0.1 -n 30 >NUL 2>&1 || PING ::1 -n 5 >NUL 2>&1
ECHO. SERVER WILL CONTINUE STARTING SOON...
PING 127.0.0.1 -n 60 >NUL 2>&1 || PING ::1 -n 5 >NUL 2>&1
GOTO _BACKUP
)

:_UPDATE
REM ++Update Rust Install++
IF EXIST .\SteamCMD GOTO _UPDATE2
wget.exe https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip --no-check-certificate
7za.exe x .\steamcmd.zip -oSteamCMD -y
DEL .\steamcmd.zip /q

:_UPDATE2
ECHO Initiating Rust Update
.\SteamCMD\steamcmd.exe +login anonymous +force_install_dir ../Rust +app_update 258550 -beta experimental validate +quit

REM ++Get the Oxide Files++
IF EXIST .\Oxide-Rust\ (DEL .\Oxide-Rust\*.* /q
RMDIR /s /q .\Oxide-Rust)

:_OXIDEUPDATE
SETLOCAL enabledelayedexpansion

echo Download latest oxide for Rust server
wget https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest --no-check-certificate
for /f "tokens=2 delims=:" %%a in ('findstr /c:tag_name latest') do SET link=%%a
SET link=%link:~1%
SET link=%link:~0,-1%
SET link=%link:"=%
wget https://github.com/OxideMod/Oxide.Rust/releases/download/%link%/Oxide.Rust.zip --no-check-certificate -O Oxide-Rust.zip
SETLOCAL Disabledelayedexpansion
echo Done.

IF EXIST .\Oxide-Rust.zip (GOTO _BACKUP) ELSE GOTO _OXIDEUPDATE

REM ++Check for the server and make a backup++

:_BACKUP
7za.exe x .\Oxide-Rust.zip -o* -y
DEL .\Oxide-Rust.zip /q
DEL latest /q
IF EXIST .\temp (DEL .\temp\*.* /q
RMDIR /s /q .\temp)
MKDIR .\temp
XCOPY /i /s /q /y .\rust\server\%_ident%\*.* .\temp\server\%_ident%\
REM ::PUT ANY OTHER FILES TO COPY HERE::
REM ::--------------------------------::
IF EXIST .\rust\RustDedicated_Data\Managed\*RustIO*.dll XCOPY /i /s /q /y .\rust\RustDedicated_Data\Managed\*RustIO*.dll .\temp\RustDedicated_Data\Managed\

REM ::--------------------------------::

IF "%_savebackup%"=="NO" (GOTO _BUILD)
IF EXIST .\temp\server\%_ident%\oxide\*.json (GOTO _ZIP) ELSE GOTO _BUILD
:_ZIP
SET backupname=backup_%_ident%-%date:~-4,4%.%date:~-7,2%.%date:~-10,2%-%time:~0,2%.%time:~3,2%
7za.exe a -r "%_backuploc%\%backupname%".zip "%~dp0\temp\*"
FOR /F "SKIP=%_maxbackups% EOL=: DELIMS=" %%F IN ('DIR /b /o-d %_backuploc%\backup_%_ident%-*.zip') DO @DEL "%_backuploc%\%%F"

:_BUILD
IF EXIST .\build RMDIR /s /q .\build
MOVE .\temp build
XCOPY /s /q /y .\Oxide-Rust .\build
IF EXIST .\build XCOPY /s /q /y .\build .\rust
RMDIR /s /q .\Oxide-Rust
IF EXIST .\build RMDIR /s /q .\build

IF "%_autostart%"=="YES" (GOTO _RUN)

SET /P ANSWER=Do you want to start Rust (Y/N)?
if /i {%ANSWER%}=={y} (GOTO _RUN)
if /i {%ANSWER%}=={yes} (GOTO _RUN)
GOTO _NORUN

:_RUN
PUSHD rust
.\RustDedicated.exe -batchmode +server.hostname %_hostname% +server.port %_port% +server.identity %_ident% +server.maxplayers %_players% +rcon.port %_rport% +rcon.password %_rcon% +rcon.ip 0.0.0.0 +server.saveinterval 3600 +server.level %_level% +server.seed %_seed% +server.url %_serverurl% +server.headerimage %_serverimg% +server.description %_serverdesc% +server.globalchat true +server.worldsize %_worldsize% +oxide.directory %_oxdir% +cfg %_cfgfile% -autoupdate -logfile output_log.txt
IF "%_autorestart%"=="NO" {
POPD
CLS
ECHO. Server %_hostname% will restart on port %_port%
PING 127.0.0.1 -n 5 >NUL 2>&1 || PING ::1 -n 5 >NUL 2>&1
GOTO _LOOP
}

EXIT

:_NORUN
CLS
ECHO. UPDATING HAS FINISHED BUT YOU HAVE DISABLED AUTOSTART 
PAUSE
EXIT

:_RKILL
CLS 
ECHO. ****YOU MUST CHANGE THE RCON PASSWORD TO RUN****
PAUSE
EXIT

 https://github.com/dixXxon/RUSTAiO

Comments est propulsé par CComment

Nous utilisons des cookies sur notre site web. Certains d’entre eux sont essentiels au fonctionnement du site et d’autres nous aident à améliorer ce site et l’expérience utilisateur (cookies traceurs). Vous pouvez décider vous-même si vous autorisez ou non ces cookies. Merci de noter que, si vous les rejetez, vous risquez de ne pas pouvoir utiliser l’ensemble des fonctionnalités du site.