-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_install_2
97 lines (91 loc) · 3.8 KB
/
server_install_2
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
# Install steam and L4D2
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz
./steamcmd.sh << STEAM
login anonymous
force_install_dir ./server1
app_update 222860 validate
force_install_dir ./server2
app_update 222860 validate
quit
STEAM
# Server download
git clone https://github.com/misdocumeno/Unifix
cp -r Unifix/* server1/left4dead2/
cp -r Unifix/* server2/left4dead2/
# Screen script
printf 'screen -S Unifix1 ./server1/srcds_run -tickrate 100 +map "c10m1_caves" +sv_clockcorrection_msecs 15 -timeout 10 +ip 0.0.0.0 -port 27015 +precache_all_survivors 1' > server_start1
chmod u+x server_start1
printf 'screen -S Unifix2 ./server2/srcds_run -tickrate 100 +map "c10m1_caves" +sv_clockcorrection_msecs 15 -timeout 10 +ip 0.0.0.0 -port 27016 +precache_all_survivors 1' > server_start2
chmod u+x server_start2
# Per server config backup 1
# Edit these files instead of the server ones
# This will be copied to the server directory when update
mkdir -p serverconfigs1/cfg/
cp Unifix/cfg/server.cfg serverconfigs1/cfg/
mkdir -p serverconfigs1/cfg/sourcemod/
cp Unifix/cfg/sourcemod/vpn_ip.cfg serverconfigs1/cfg/sourcemod/vpn_ip.cfg
mkdir -p serverconfigs1/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/sourcebans/sourcebans.cfg serverconfigs1/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/databases.cfg serverconfigs1/addons/sourcemod/configs/
# Per server config backup 2
# Edit these files instead of the server ones
# This will be copied to the server directory when update
mkdir -p serverconfigs2/cfg/
cp Unifix/cfg/server.cfg serverconfigs2/cfg/
mkdir -p serverconfigs2/cfg/sourcemod/
cp Unifix/cfg/sourcemod/vpn_ip.cfg serverconfigs2/cfg/sourcemod/vpn_ip.cfg
mkdir -p serverconfigs2/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/sourcebans/sourcebans.cfg serverconfigs2/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/databases.cfg serverconfigs2/addons/sourcemod/configs/
# Update script 1
printf '%s\n' \
'killall screen' \
'cd Unifix' \
'git pull' \
'rm -rf ../server1/left4dead2/addons/sourcemod/' \
'rm -rf ../server1/left4dead2/cfg/sourcemod/' \
'rm -rf ../server1/left4dead2/cfg/cfgogl/' \
'rm -rf ../server1/left4dead2/cfg/stripper/' \
'rm ../server1/left4dead2/cfg/generalfixes.cfg' \
'rm ../server1/left4dead2/cfg/sharedplugins.cfg' \
'rm ../server1/left4dead2/cfg/server.cfg' \
'rm ../server1/left4dead2/host.txt' \
'rm ../server1/left4dead2/motd.txt' \
'cp -r * ../server1/left4dead2/' \
'git reset HEAD --hard' \
'cd ..' \
'cd serverconfigs1' \
'rm ../server1/left4dead2/cfg/server.cfg' \
'rm ../server1/left4dead2/cfg/sourcemod/vpn_ip.cfg' \
'rm ../server1/left4dead2/cfg/sourcemod/configs/databases.cfg' \
'rm ../server1/left4dead2/cfg/sourcemod/configs/sourcebans/sourcebans.cfg' \
'cp -r * ../server1/left4dead2/' \
> server_update1
chmod u+x server_update1
# Update script 2
printf '%s\n' \
'killall screen' \
'cd Unifix' \
'git pull' \
'rm -rf ../server2/left4dead2/addons/sourcemod/' \
'rm -rf ../server2/left4dead2/cfg/sourcemod/' \
'rm -rf ../server2/left4dead2/cfg/cfgogl/' \
'rm -rf ../server2/left4dead2/cfg/stripper/' \
'rm ../server2/left4dead2/cfg/generalfixes.cfg' \
'rm ../server2/left4dead2/cfg/sharedplugins.cfg' \
'rm ../server2/left4dead2/cfg/confogl_personalize.cfg' \
'rm ../server2/left4dead2/cfg/server.cfg' \
'rm ../server2/left4dead2/host.txt' \
'rm ../server2/left4dead2/motd.txt' \
'cp -r * ../server2/left4dead2/' \
'git reset HEAD --hard' \
'cd ..' \
'cd serverconfigs2' \
'rm ../server2/left4dead2/cfg/server.cfg' \
'rm ../server2/left4dead2/cfg/sourcemod/vpn_ip.cfg' \
'rm ../server2/left4dead2/cfg/sourcemod/configs/databases.cfg' \
'rm ../server2/left4dead2/cfg/sourcemod/configs/sourcebans/sourcebans.cfg' \
'cp -r * ../server2/left4dead2/' \
> server_update2
chmod u+x server_update2