forked from DDRRE/ddut4
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ddut4_init.def
146 lines (117 loc) · 4 KB
/
ddut4_init.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
### DDRRE's UT4 Server Suite
### Initialization Routine File
# Version 0.4c
### NOTE: EVERYTHING is case sensitive.
####################################
# DON'T EDIT THIS SECTION #
####################################
#Finding and sourcing ddut4.conf
for cnffiles_init in ddut4.conf
do
if [ -f "$cnffiles_init" ]
then
source "$cnffiles_init"
if [[ $? != '0' ]]
then
echo "Couldn't load ${cnffiles_init}. Terminating."
exit 1
#no need for 'else' here
fi
if [[ $unatt != '1' ]]
then
echo "Loaded configuration file: /etc/${cnffiles_init}"
fi
elif [ -f /etc/${cnffiles_init} ]
then
source /etc/${cnffiles_init}
if [[ $? != '0' ]]
then
echo "Couldn't load /etc/${cnffiles_init}. Terminating."
exit 1
fi
if [[ $unatt != '1' ]]
then
echo "Loaded configuration file: /etc/${cnffiles_init}"
fi
else
echo "Couldn't find ${cnffiles_init}. Terminating."
exit 1
fi
done
#########################################
# #
#=======================================#
#-- OPTIONAL: Additional tweaks --#
#=======================================#
#Override default advanced settings here#
#=======================================#
## Where should the base UT4 server skeleton be stored?
basedir="${rootdir}/ut4-base"
## Set this to 1 to disable the scheduler when updating
cronctl=0
## Where should the update be downloaded to (temporary)?
dldir="${rootdir}"
## Where should the updater look for Engine.ini, SRVNAME-Game.ini, SRVNAME-Rules.ini configuration files?
## If these files are not found, the server's configuration files will not be modified.
confdir="${rootdir}"
## Change this if the server binary has changed
serverproc='UE4Server-Linux-Shipping'
## Server watchdog refresh interval (in seconds):
wdrefresh=30
## Keep downloaded server package? (Not necessary. To re-deploy, just use "install" as the URL to deploy from ut$
keepdl=0
## Copy using hardlinks (saved space by mirroring the base game package)
cplink=1
# Inside the upgrade package archive, this should be the directory name with UnrealTournament in it:
zipdir="LinuxServer"
####################################
###################################################
## Initializing configuration and common functions
iecho () {
#echo only if interactive
if [[ $unatt != '1' ]]
then
echo "$@"
fi
}
kthxbye () {
echo
echo "Terminating."
exit $1
}
testcnf () {
#generic failure for undefined vars
for i in $@
do
if [[ $1 == '' ]]
then
echo "$1 not defined. ddut4.conf is not fully configured."
echo "The script cannot continue."
kthxbye 1
fi
done
}
testcnf rootdir basedir cronctl dldir confdir serverproc wdrefresh keepdl cplink
if [[ $srvnames == '' ]]
then
echo "No servers defined."
echo "Please define SRVNAMEs in ddut4.conf."
kthxbye 1
fi
for i in $srvnames
do
add=" ${rootdir}/ut4-$i"
update="${update}${add}"
if [[ $(eval echo \$${i}_CMD) == '' ]]
then
echo "No launch command found for $i."
echo "Please define ${i}_CMD in the configuration file."
kthxbye 1
fi
done
iecho "Servers defined: $srvnames"
sheader() {
echo
echo "DDRRE's UT4 Server Suite v0.4c"
echo "=============================="
}