-
Notifications
You must be signed in to change notification settings - Fork 0
/
server_install_both
107 lines (98 loc) · 3.97 KB
/
server_install_both
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
# 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 ./server
app_update 222860 validate
quit
STEAM
./steamcmd.sh << STEAMT1
login anonymous
force_install_dir ./serverT1
app_update 222860 validate
quit
STEAMT1
# Server download
git clone https://github.com/misdocumeno/Unifix
cp -r Unifix/* server/left4dead2/
# Server T1 download
git clone https://github.com/misdocumeno/Unifix_T1
cp -r Unifix_T1/* serverT1/left4dead2/
# Screen script
printf 'screen -S Unifix ./server/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_start
chmod u+x server_start
# Screen T1 script
printf 'screen -S Unifix_T1 ./serverT1/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_startT1
chmod u+x server_startT1
# Per server config backup
# Edit these files instead of the server ones
# This will be copied to the server directory when update
mkdir -p serverconfigs/cfg/
cp Unifix/cfg/server.cfg serverconfigs/cfg/
mkdir -p serverconfigs/cfg/sourcemod/
cp Unifix/cfg/sourcemod/vpn_ip.cfg serverconfigs/cfg/sourcemod/vpn_ip.cfg
mkdir -p serverconfigs/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/sourcebans/sourcebans.cfg serverconfigs/addons/sourcemod/configs/sourcebans/
cp Unifix/addons/sourcemod/configs/databases.cfg serverconfigs/addons/sourcemod/configs/
# Per server config backup T1
# Edit these files instead of the server ones
# This will be copied to the server directory when update
mkdir -p serverconfigsT1/cfg/
cp Unifix_T1/cfg/server.cfg serverconfigsT1/cfg/
mkdir -p serverconfigsT1/cfg/sourcemod/
cp Unifix_T1/cfg/sourcemod/vpn_ip.cfg serverconfigsT1/cfg/sourcemod/vpn_ip.cfg
mkdir -p serverconfigsT1/addons/sourcemod/configs/sourcebans/
cp Unifix_T1/addons/sourcemod/configs/sourcebans/sourcebans.cfg serverconfigsT1/addons/sourcemod/configs/sourcebans/
cp Unifix_T1/addons/sourcemod/configs/databases.cfg serverconfigsT1/addons/sourcemod/configs/
# Update script
printf '%s\n' \
'killall screen' \
'cd Unifix' \
'git pull' \
'rm -rf ../server/left4dead2/addons/sourcemod/' \
'rm -rf ../server/left4dead2/cfg/sourcemod/' \
'rm -rf ../server/left4dead2/cfg/cfgogl/' \
'rm -rf ../server/left4dead2/cfg/stripper/' \
'rm ../server/left4dead2/cfg/generalfixes.cfg' \
'rm ../server/left4dead2/cfg/sharedplugins.cfg' \
'rm ../server/left4dead2/cfg/server.cfg' \
'rm ../server/left4dead2/host.txt' \
'rm ../server/left4dead2/motd.txt' \
'cp -r * ../server/left4dead2/' \
'git reset HEAD --hard' \
'cd ..' \
'cd serverconfigs' \
'rm ../server/left4dead2/cfg/server.cfg' \
'rm ../server/left4dead2/cfg/sourcemod/vpn_ip.cfg' \
'rm ../server/left4dead2/cfg/sourcemod/configs/databases.cfg' \
'rm ../server/left4dead2/cfg/sourcemod/configs/sourcebans/sourcebans.cfg' \
'cp -r * ../server/left4dead2/' \
> server_update
chmod u+x server_update
# Update script T1
printf '%s\n' \
'killall screen' \
'cd Unifix_T1' \
'git pull' \
'rm -rf ../serverT1/left4dead2/addons/sourcemod/' \
'rm -rf ../serverT1/left4dead2/cfg/sourcemod/' \
'rm -rf ../serverT1/left4dead2/cfg/cfgogl/' \
'rm -rf ../serverT1/left4dead2/cfg/stripper/' \
'rm ../serverT1/left4dead2/cfg/generalfixes.cfg' \
'rm ../serverT1/left4dead2/cfg/sharedplugins.cfg' \
'rm ../serverT1/left4dead2/cfg/confogl_personalize.cfg' \
'rm ../serverT1/left4dead2/cfg/server.cfg' \
'rm ../serverT1/left4dead2/host.txt' \
'rm ../serverT1/left4dead2/motd.txt' \
'cp -r * ../serverT1/left4dead2/' \
'git reset HEAD --hard' \
'cd ..' \
'cd serverconfigsT1' \
'rm ../serverT1/left4dead2/cfg/server.cfg' \
'rm ../serverT1/left4dead2/cfg/sourcemod/vpn_ip.cfg' \
'rm ../serverT1/left4dead2/cfg/sourcemod/configs/databases.cfg' \
'rm ../serverT1/left4dead2/cfg/sourcemod/configs/sourcebans/sourcebans.cfg' \
'cp -r * ../serverT1/left4dead2/' \
> server_updateT1
chmod u+x server_updateT1