finished
This commit is contained in:
208
start.sh
Executable file
208
start.sh
Executable file
@@ -0,0 +1,208 @@
|
|||||||
|
#!/bin/sh -e
|
||||||
|
#
|
||||||
|
# shellcheck disable=2043
|
||||||
|
#
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# General Settings
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
export DAYZ_FILES=/mnt/dayz
|
||||||
|
export STOCK_SERVER_DATA="$DAYZ_FILES/stock/DayZServer"
|
||||||
|
|
||||||
|
export MAIN="/mnt/c/DAYZ"
|
||||||
|
export SERVERS="$MAIN/servers"
|
||||||
|
export CACHE="$MAIN/cache"
|
||||||
|
export STORAGE="$MAIN/STORAGE"
|
||||||
|
|
||||||
|
export MOD_CACHE="$CACHE/mods"
|
||||||
|
export RESTART_INTERVAL=$(( 15 * 60 + 30 ))
|
||||||
|
#$((60 * 60 * 4 + 3))
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# SERVER SPECIFIC SETTINGS
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
export SERVER_NAME='ZyaD Chernarus'
|
||||||
|
export SERVER_HOME="$SERVERS/$SERVER_NAME"
|
||||||
|
export MAP_FOLDER_NAME='chernarus'
|
||||||
|
export LOCAL_FOLDER_MAP_NAME='dayzOffline.chernarusplus'
|
||||||
|
export SERVER_PORT=2302
|
||||||
|
export SERVER_CPU=8
|
||||||
|
export SERVER_CONFIG_FILE="$SERVER_HOME/serverDZ.cfg"
|
||||||
|
export SERVER_STORAGE="$STORAGE/$SERVER_NAME"
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# Helper functions
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
alias do_sync='rsync -vrltDhu --delete --partial --progress'
|
||||||
|
alias do_secure_sync='rsync -cvrltDhu --delete --partial --progress'
|
||||||
|
|
||||||
|
msg() {
|
||||||
|
>&2 printf '[*] %s ...\n' "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die() {
|
||||||
|
msg "$*"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
debug() {
|
||||||
|
if [ "$DEBUG" ] ; then
|
||||||
|
>&2 printf ' DEBUG: %s\n' "$*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# Checks
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
check() {
|
||||||
|
mkdir -p "$DAYZ_FILES"
|
||||||
|
|
||||||
|
if ! mount | grep -i "$DAYZ_FILES" >/dev/null ; then
|
||||||
|
msg "$DAYZ_FILES is not mounted!"
|
||||||
|
echo "hint: mount -t drvfs //truenas.home.weaver/dayz $DAYZ_FILES"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for storage_folder in "$SERVER_STORAGE" "$SERVER_STORAGE/Profilesfolder" "$SERVER_STORAGE/storage_1" ; do
|
||||||
|
if [ ! -d "$storage_folder" ] ; then
|
||||||
|
die "FOLDER '$storage_folder' DOES NOT EXIST"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# Environment Setup
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
init() {
|
||||||
|
mkdir -p "$SERVER_HOME" "$MOD_CACHE/$MAP_FOLDER_NAME"
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_environment() {
|
||||||
|
msg "Copying stock server data"
|
||||||
|
|
||||||
|
# list of all stock folders
|
||||||
|
for folder in addons battleye bliss docs dta keys ; do
|
||||||
|
do_sync "$STOCK_SERVER_DATA/$folder"/ "$SERVER_HOME/$folder" || die "Failed to copy stock: $folder"
|
||||||
|
done
|
||||||
|
|
||||||
|
# list of all stock files
|
||||||
|
for file in ban.txt dayz.gproj dayzsettings.xml serverDZ.cfg whitelist.txt ; do
|
||||||
|
do_sync "$STOCK_SERVER_DATA/$file"/ "$SERVER_HOME/$file" || die "Failed to copy stock: $file"
|
||||||
|
done
|
||||||
|
|
||||||
|
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
# NOTE: TODO: Namalsk etc will need this changed!@@!@!@!@!@
|
||||||
|
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
msg "Copying stock mpmissions data"
|
||||||
|
do_sync --exclude="*storage_1*" "$STOCK_SERVER_DATA/mpmissions/dayzOffline.enoch"/ "$SERVER_HOME/mpmissions/dayzOffline.enoch"
|
||||||
|
do_sync --exclude="*storage_1*" "$STOCK_SERVER_DATA/mpmissions/dayzOffline.chernarusplus"/ "$SERVER_HOME/mpmissions/dayzOffline.chernarusplus"
|
||||||
|
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||||
|
|
||||||
|
msg "Copying mod files"
|
||||||
|
do_sync "$DAYZ_FILES/mods/$MAP_FOLDER_NAME"/ "$MOD_CACHE/$MAP_FOLDER_NAME" || die "Failed to copy mod files"
|
||||||
|
|
||||||
|
if [ ! -f "$SERVER_HOME/DZSALModServer.exe" ] ; then
|
||||||
|
msg "Copying DZSA executable"
|
||||||
|
do_secure_sync "$DAYZ_FILES/software/DZSALModServer.exe" "$SERVER_HOME/DZSALModServer.exe"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# Load Mods
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
load_mods() {
|
||||||
|
if [ ! -f "$MOD_CACHE/$MAP_FOLDER_NAME/mods.txt" ] ; then
|
||||||
|
die "mods.txt list missing"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$SERVER_HOME/mods"
|
||||||
|
|
||||||
|
modstring=""
|
||||||
|
while read -r mod ; do
|
||||||
|
case $mod in
|
||||||
|
'@'*)
|
||||||
|
msg "- Found mod: $mod"
|
||||||
|
modstring="$modstring;mods/$mod"
|
||||||
|
do_sync "$MOD_CACHE/$MAP_FOLDER_NAME/$mod"/ "$SERVER_HOME/mods/$mod"
|
||||||
|
|
||||||
|
for addon_folder in addons Addons addon Addon ; do
|
||||||
|
if [ -d "$SERVER_HOME/mods/$mod/$addon_folder" ] ; then
|
||||||
|
for addon in "$SERVER_HOME/mods/$mod/$addon_folder"/* ; do
|
||||||
|
if [ ! -f "$SERVER_HOME/addons/${addon##*/}" ] ; then
|
||||||
|
do_sync "$addon" "$SERVER_HOME/addons/${addon##*/}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for key_folder in keys Keys key Key ; do
|
||||||
|
if [ -d "$SERVER_HOME/mods/$mod/$key_folder" ] ; then
|
||||||
|
for key in "$SERVER_HOME/mods/$mod/$key_folder"/* ; do
|
||||||
|
if [ ! -f "$SERVER_HOME/keys/${key##*/}" ] ; then
|
||||||
|
do_sync "$key" "$SERVER_HOME/keys/${key##*/}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
esac
|
||||||
|
done < "$MOD_CACHE/$MAP_FOLDER_NAME/mods.txt"
|
||||||
|
|
||||||
|
# trim the initial leading ';'
|
||||||
|
modstring=${modstring#;}
|
||||||
|
printf '%s\n' "$modstring"
|
||||||
|
}
|
||||||
|
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
# Main
|
||||||
|
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
||||||
|
main() {
|
||||||
|
init
|
||||||
|
cd "$SERVER_HOME" || die "Could not cd to '$SERVER_HOME'"
|
||||||
|
|
||||||
|
check || die "Failed check"
|
||||||
|
|
||||||
|
msg "Setting up environment"
|
||||||
|
setup_environment || die "Could not set up environment."
|
||||||
|
|
||||||
|
msg "Loading mods"
|
||||||
|
mod_string=$(load_mods)
|
||||||
|
|
||||||
|
>&2 printf 'MOD_STRING: %s\n' "$mod_string"
|
||||||
|
|
||||||
|
echo '===================================='
|
||||||
|
printf '%s - Server started.\n' "$(date)"
|
||||||
|
echo '===================================='
|
||||||
|
|
||||||
|
cmd.exe /C start "DayZ Server" /min "DZSALModServer.exe" \
|
||||||
|
-config="$SERVER_CONFIG_FILE" \
|
||||||
|
-port="$SERVER_PORT" \
|
||||||
|
-profiles=Profilesfolder \
|
||||||
|
-mod="$mod_string" \
|
||||||
|
-cpuCount="$SERVER_CPU" \
|
||||||
|
-dologs -adminlog \
|
||||||
|
-netlog -freezecheck
|
||||||
|
|
||||||
|
msg "Sleeping for: $RESTART_INTERVAL"
|
||||||
|
sleep "$RESTART_INTERVAL"
|
||||||
|
count=0
|
||||||
|
while [ "$count" -lt "$RESTART_INTERVAL" ] ; do
|
||||||
|
sleep 60
|
||||||
|
count=$((count + 60))
|
||||||
|
msg "TIME LEFT BEFORE RESTART: $(( (RESTART_INTERVAL - count) / 60 )) minutes"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "==========================="
|
||||||
|
|
||||||
|
msg "Time up"
|
||||||
|
msg "Killing server"
|
||||||
|
cmd.exe /C taskkill /im DayZServer_x64.exe /F
|
||||||
|
|
||||||
|
msg "Sleeping 10 seconds to settle"
|
||||||
|
sleep 10
|
||||||
|
msg "SERVER IS RESTARTING"
|
||||||
|
}
|
||||||
|
|
||||||
|
while : ; do
|
||||||
|
main "$@"
|
||||||
|
done
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
hostname = "ZyaD Chernaurus (Traditional, True DayZ) | discord.gg/mD5KGCrn2f"; // Server name
|
|
||||||
password = ""; // Password to connect to the server
|
|
||||||
passwordAdmin = ""; // Password to become a server admin
|
|
||||||
|
|
||||||
enableWhitelist = 0; // Enable/disable whitelist (value 0-1)
|
|
||||||
|
|
||||||
maxPlayers = 100; // Maximum amount of players
|
|
||||||
|
|
||||||
|
|
||||||
steamqueryport = 2305;
|
|
||||||
|
|
||||||
verifySignatures = 2; // Verifies .pbos against .bisign files. (only 2 is supported)
|
|
||||||
forceSameBuild = 1; // When enabled, the server will allow the connection only to clients with same the .exe revision as the server (value 0-1)
|
|
||||||
|
|
||||||
disableVoN = 0; // Enable/disable voice over network (value 0-1)
|
|
||||||
vonCodecQuality = 20; // Voice over network codec quality, the higher the better (values 0-30)
|
|
||||||
|
|
||||||
disable3rdPerson=1; // Toggles the 3rd person view for players (value 0-1)
|
|
||||||
disableCrosshair=1; // Toggles the cross-hair (value 0-1)
|
|
||||||
|
|
||||||
disablePersonalLight = 1; // Disables personal light for all clients connected to server
|
|
||||||
lightingConfig = 0; // 0 for brighter night setup, 1 for darker night setup
|
|
||||||
|
|
||||||
serverTime="SystemTime"; // Initial in-game time of the server. "SystemTime" means the local time of the machine. Another possibility is to set the time to some value in "YYYY/MM/DD/HH/MM" format, f.e. "2015/4/8/17/23" .
|
|
||||||
serverTimeAcceleration=12; // Accelerated Time (value 0-24)// This is a time multiplier for in-game time. In this case, the time would move 24 times faster than normal, so an entire day would pass in one hour.
|
|
||||||
serverNightTimeAcceleration=1.5; // Accelerated Nigh Time - The numerical value being a multiplier (0.1-64) and also multiplied by serverTimeAcceleration value. Thus, in case it is set to 4 and serverTimeAcceleration is set to 2, night time would move 8 times faster than normal. An entire night would pass in 3 hours.
|
|
||||||
serverTimePersistent=1; // Persistent Time (value 0-1)// The actual server time is saved to storage, so when active, the next server start will use the saved time value.
|
|
||||||
|
|
||||||
guaranteedUpdates=1; // Communication protocol used with game server (use only number 1)
|
|
||||||
|
|
||||||
loginQueueConcurrentPlayers=10; // The number of players concurrently processed during the login process. Should prevent massive performance drop during connection when a lot of people are connecting at the same time.
|
|
||||||
loginQueueMaxPlayers=100; // The maximum number of players that can wait in login queue
|
|
||||||
|
|
||||||
instanceId = 1; // DayZ server instance id, to identify the number of instances per box and their storage folders with persistence files
|
|
||||||
|
|
||||||
storageAutoFix = 1; // Checks if the persistence files are corrupted and replaces corrupted ones with empty ones (value 0-1)
|
|
||||||
|
|
||||||
|
|
||||||
class Missions
|
|
||||||
{
|
|
||||||
class DayZ
|
|
||||||
{
|
|
||||||
template="dayzOffline.chernarusplus"; // Mission to load on server startup. <MissionName>.<TerrainName>
|
|
||||||
// Vanilla mission: dayzOffline.chernarusplus
|
|
||||||
// DLC mission: dayzOffline.enoch
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
@echo off
|
|
||||||
:start
|
|
||||||
|
|
||||||
set NAS=//truenas.home.weaver/dayz
|
|
||||||
|
|
||||||
::################Server name
|
|
||||||
set serverName="ZyaD Chernaurus (Traditional, True DayZ) | discord.gg/mD5KGCrn2f"
|
|
||||||
set modFolderName="chernaurus"
|
|
||||||
set serverPort=2302
|
|
||||||
set serverCPU=8
|
|
||||||
set mods_generic="mods/@dabsframework;mods/@cf;mods/@vppadmintools;mods/@earplugs;mods/@notes;mods/@noweaponraise;mods/@healthregen;mods/@enoughstamina;mods/@tentbackpacks;mods/@causeofdeath;mods/@bearbuff;mods/@durablesuppressors;mods/@customanimations;mods/@wornrepair;mods/@firefuel;mods/@gunmovesounds;mods/@badfood"
|
|
||||||
set mods_sUDE="mods/@sframework;mods/@svisual"
|
|
||||||
set mods_generic_after_sUDE="mods/@nodof"
|
|
||||||
set mods_cherno="mods/@spurglesbagz;mods/@fliptransport;mods/@novehicledamage;mods/@docscarfixes;mods/@ladslightingoverhaul;mods/@uncuepascivilianclothing"
|
|
||||||
|
|
||||||
::#####################Server files location
|
|
||||||
set serverLocation="c:\dayzserver\DZSALModServer"
|
|
||||||
cd "%serverLocation%"
|
|
||||||
set serverConfig=serverDZ.cfg
|
|
||||||
title %serverName% batch
|
|
||||||
|
|
||||||
:: ################ COPY STOCK DAYZ SERVER DATA #########################
|
|
||||||
echo Copying stock server data
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/addons/ addons
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/keys/ keys
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/battleye/ battleye
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/bliss/ bliss
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/docs/ docs
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/dta/ dta
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/mpmissions/ mpmissions
|
|
||||||
|
|
||||||
:: ################ COPY SERVER MOD FILES #########################
|
|
||||||
echo Copying Mod List
|
|
||||||
rsync -arvhu --progress --delete --partial "%NAS%/mods/%modFolderName%"/mods.txt mods.txt
|
|
||||||
echo COPYING MODS
|
|
||||||
rsync -arvhu --progress --delete --partial "%NAS%/mods/%modFolderName%"/ mods"
|
|
||||||
echo COPYING MOD ADDONS
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/addons addons /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
|
|
||||||
echo COPYING MOD KEYS
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/keys keys /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/key keys /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
|
|
||||||
:: ################ COPY SERVER CONFIG FILES #########################
|
|
||||||
echo Copying Config Files
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/all/messages.xml mpmissions/dayzOffline.chernarusplus/db/messages.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/globals.xml mpmissions/dayzOffline.chernarusplus/db/globals.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/economy.xml mpmissions/dayzOffline.chernarusplus/db/economy.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/types.xml mpmissions/dayzOffline.chernarusplus/db/types.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/cfggameplay.json mpmissions/dayzOffline.chernarusplus/cfggameplay.json
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/Profilesfolder/sUDE/ Profilesfolder/sUDE
|
|
||||||
|
|
||||||
:: ################ COPY SERVER STORAGE #########################
|
|
||||||
echo Copying Server Storage
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/STORAGE/cherno/ mpmissions/dayzOffline.chernarusplus/storage_1
|
|
||||||
|
|
||||||
::###########Launch parameters (edit end: -config=|-port=|-profiles=|-doLogs|-adminLog|-netLog|-freezeCheck|-filePatching|-BEpath=|-cpuCount=)
|
|
||||||
echo (%time%) %serverName% started.
|
|
||||||
start "DayZ Server" /min "DZSALModServer.exe" -config=%serverConfig% -port=2302 -profiles=Profilesfolder "-mod=%mods_generic%;%mods_sUDE%;%mods_generic_after_sUDE%;%mods_cherno%" -cpuCount=%serverCPU% -dologs -adminlog -netlog -freezecheck
|
|
||||||
|
|
||||||
::###############Time in seconds before kill server process (14400 = 4 hours)
|
|
||||||
timeout 14403
|
|
||||||
taskkill /im DayZServer_x64.exe /F
|
|
||||||
|
|
||||||
::##### Save Storage
|
|
||||||
echo Sleeping 10 and storing storage
|
|
||||||
timeout 10
|
|
||||||
rsync -acrvhu --progress --delete --partial mpmissions/dayzOffline.chernarusplus/storage_1/ %NAS%/STORAGE/cherno
|
|
||||||
|
|
||||||
::##################Loop
|
|
||||||
echo Storage saved we are now restarting
|
|
||||||
timeout 10
|
|
||||||
goto start
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
@echo off
|
|
||||||
:start
|
|
||||||
|
|
||||||
set NAS=//truenas.home.weaver/dayz
|
|
||||||
|
|
||||||
::################Server name
|
|
||||||
set serverName="ZyaD Chernaurus (Traditional, True DayZ) | discord.gg/mD5KGCrn2f"
|
|
||||||
set modFolderName="chernaurus"
|
|
||||||
set serverPort=2302
|
|
||||||
set serverCPU=8
|
|
||||||
|
|
||||||
set mods_generic="mods/@dabsframework;mods/@cf;mods/@vppadmintools;mods/@earplugs;mods/@notes;mods/@noweaponraise;mods/@healthregen;mods/@enoughstamina;mods/@tentbackpacks;mods/@causeofdeath;mods/@bearbuff;mods/@durablesuppressors;mods/@customanimations;mods/@wornrepair;mods/@firefuel;mods/@gunmovesounds;mods/@badfood"
|
|
||||||
set mods_sUDE="mods/@sframework;mods/@svisual"
|
|
||||||
set mods_generic_after_sUDE="mods/@nodof"
|
|
||||||
set mods_cherno="mods/@spurglesbagz;mods/@fliptransport;mods/@novehicledamage;mods/@docscarfixes;mods/@ladslightingoverhaul;mods/@uncuepascivilianclothing"
|
|
||||||
|
|
||||||
::#####################Server files location
|
|
||||||
set serverLocation="c:\dayzserver\DZSALModServer"
|
|
||||||
cd "%serverLocation%"
|
|
||||||
set serverConfig=serverDZ.cfg
|
|
||||||
|
|
||||||
:: ################ COPY STOCK DAYZ SERVER DATA #########################
|
|
||||||
echo Copying stock server data
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/addons/ addons
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/keys/ keys
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/battleye/ battleye
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/bliss/ bliss
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/docs/ docs
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/dta/ dta
|
|
||||||
rsync -arvhu --progress --delete --partial %NAS%/DayZServer/mpmissions/ mpmissions
|
|
||||||
|
|
||||||
:: ################ COPY SERVER MOD FILES #########################
|
|
||||||
echo COPYING MODS
|
|
||||||
rsync -arvhu --progress --delete --partial "%NAS%/mods/%modFolderName%"/ mods"
|
|
||||||
echo COPYING MOD ADDONS
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/addons addons /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
|
|
||||||
echo COPYING MOD KEYS
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/keys keys /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
FOR /d %%y IN (mods\*) DO robocopy %%y/key keys /E /XC /XN /XO /njh /njs /ndl /nc /ns /nfl
|
|
||||||
|
|
||||||
:: ################ COPY SERVER CONFIG FILES #########################
|
|
||||||
echo Copying Config Files
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/all/messages.xml mpmissions/dayzOffline.chernarusplus/db/messages.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/globals.xml mpmissions/dayzOffline.chernarusplus/db/globals.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/economy.xml mpmissions/dayzOffline.chernarusplus/db/economy.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/types.xml mpmissions/dayzOffline.chernarusplus/db/types.xml
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/chernaurus/cfggameplay.json mpmissions/dayzOffline.chernarusplus/cfggameplay.json
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/server_configs/Profilesfolder/sUDE/ Profilesfolder/sUDE
|
|
||||||
|
|
||||||
:: ################ COPY SERVER STORAGE #########################
|
|
||||||
echo Copying Server Storage
|
|
||||||
rsync -acrvhu --progress --delete --partial %NAS%/STORAGE/cherno/ mpmissions/dayzOffline.chernarusplus/storage_1
|
|
||||||
|
|
||||||
::###########Launch parameters (edit end: -config=|-port=|-profiles=|-doLogs|-adminLog|-netLog|-freezeCheck|-filePatching|-BEpath=|-cpuCount=)
|
|
||||||
echo (%time%) %serverName% started.
|
|
||||||
start "DayZ Server" /min "DZSALModServer.exe" -config=%serverConfig% -port=2302 -profiles=Profilesfolder "-mod=%mods_generic%;%mods_sUDE%;%mods_generic_after_sUDE%;%mods_cherno%" -cpuCount=%serverCPU% -dologs -adminlog -netlog -freezecheck
|
|
||||||
|
|
||||||
::###############Time in seconds before kill server process (14400 = 4 hours)
|
|
||||||
timeout 14403
|
|
||||||
taskkill /im DayZServer_x64.exe /F
|
|
||||||
|
|
||||||
::##### Save Storage
|
|
||||||
echo Sleeping 10 and storing storage
|
|
||||||
timeout 10
|
|
||||||
rsync -acrvhu --progress --delete --partial mpmissions/dayzOffline.chernarusplus/storage_1/ %NAS%/STORAGE/cherno
|
|
||||||
|
|
||||||
::##################Loop
|
|
||||||
echo Storage saved we are now restarting
|
|
||||||
timeout 10
|
|
||||||
goto start
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# General Settings
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
export DAYZ_FILES=/mnt/dayz
|
|
||||||
export STOCK_SERVER_DATA="$DAYZ_FILES/stock/DayZServer"
|
|
||||||
export SERVERS="$HOME/servers"
|
|
||||||
export CACHE="$HOME/cache"
|
|
||||||
export MOD_CACHE="$CACHE/mods"
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# SERVER SPECIFIC SETTINGS
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
export SERVER_NAME='ZyaD Chernaurus'
|
|
||||||
export SERVER_HOME="$SERVERS/$SERVER_NAME"
|
|
||||||
export MAP_FOLDER_NAME='chernaurus'
|
|
||||||
export SERVER_PORT=2302
|
|
||||||
export SERVER_CPU=8
|
|
||||||
export SERVER_CONFIG_FILE="$SERVER_HOME/serverDZ.cfg"
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# Helper functions
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
alias do_sync='rsync -arvhu --progress --delete --partial'
|
|
||||||
alias do_secure_sync='rsync -arcvhu --progress --delete --partial'
|
|
||||||
|
|
||||||
msg() {
|
|
||||||
>&2 printf '[*] %s\n' "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
die() {
|
|
||||||
msg "$*"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# Checks
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
check() {
|
|
||||||
mkdir -p "$DAYZ_FILES"
|
|
||||||
|
|
||||||
if ! mount | grep -i "$DAYZ_FILES" >/dev/null ; then
|
|
||||||
msg "mount -t drvfs XXXXXXX $DAYZ_FILES"
|
|
||||||
die "$DAYZ_FILES is not mounted!"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# Environment Setup
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
init() {
|
|
||||||
mkdir -p "$SERVER_HOME" "$MOD_CACHE/$MAP_FOLDER_NAME"
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_environment() {
|
|
||||||
msg "Copying stock server data."
|
|
||||||
do_sync "$STOCK_SERVER_DATA"/ "$SERVER_HOME" || die "Failed to sync $STOCK_SERVER_DATA to $SERVER_HOME"
|
|
||||||
}
|
|
||||||
|
|
||||||
copy_mods() {
|
|
||||||
msg "Coyping mod files"
|
|
||||||
do_sync "$DAYZ_FILES/mods/$MAP_FOLDER_NAME"/ "$MOD_CACHE/$MAP_FOLDER_NAME"
|
|
||||||
}
|
|
||||||
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
# Main
|
|
||||||
# -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
|
|
||||||
main() {
|
|
||||||
init
|
|
||||||
cd "$SERVER_HOME" || die "Could not cd to '$SERVER_HOME'"
|
|
||||||
check
|
|
||||||
msg "Setting up environment."
|
|
||||||
setup_environment
|
|
||||||
copy_mods
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
Reference in New Issue
Block a user