-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstartup.sh
executable file
·57 lines (51 loc) · 2.56 KB
/
startup.sh
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
#!/bin/bash
COMMAND=$1
shift
if [ "$COMMAND" == "bash" ]; then
/bin/bash
fi
if [ "$COMMAND" == "update" ] || [ "$COMMAND" == "updaterun" ]; then
/opt/steamcmd/steamcmd.sh \
+login anonymous \
+force_install_dir /opt/insurgency \
+app_update "581330 -beta community-exp" validate \
+quit
fi
echo "copying teaked game config from /app/Insurgency/ to /opt/insurgency/Insurgency/"
cp -R /app/Insurgency/ /opt/insurgency/
sed s/RconPasswordAAA/$RCON_PASSWORD/ /app/Insurgency/Saved/Config/LinuxServer/Game.ini | \
sed s/RconPortAAA/$RCON_PORT/ | \
cat > /opt/insurgency/Insurgency/Saved/Config/LinuxServer/Game.ini
if [ "$COMMAND" == "run" ] || [ "$COMMAND" == "updaterun" ]; then
#Everytime the server start up or restart, it will start with a random map
strMapList=()
strMapList+=("Canyon?Scenario=Scenario_Crossing_Checkpoint_Insurgents")
strMapList+=("Canyon?Scenario=Scenario_Crossing_Checkpoint_Security")
strMapList+=("Farmhouse?Scenario=Scenario_Farmhouse_Checkpoint_Insurgents")
strMapList+=("Farmhouse?Scenario=Scenario_Farmhouse_Checkpoint_Security")
strMapList+=("Mountain?Scenario=Scenario_Summit_Checkpoint_Insurgents")
strMapList+=("Mountain?Scenario=Scenario_Summit_Checkpoint_Security")
strMapList+=("OilField?Scenario=Scenario_Refinery_Checkpoint_Insurgents")
strMapList+=("OilField?Scenario=Scenario_Refinery_Checkpoint_Security")
strMapList+=("Precinct?Scenario=Scenario_Precinct_Checkpoint_Insurgents")
strMapList+=("Precinct?Scenario=Scenario_Precinct_Checkpoint_Security")
strMapList+=("Town?Scenario=Scenario_Hideout_Checkpoint_Insurgents")
strMapList+=("Town?Scenario=Scenario_Hideout_Checkpoint_Security")
#set random seed
RANDOM=$$$(date +%N)
#set map
strMap=${strMapList[$RANDOM % ${#strMapList[@]}]}
strMap="Farmhouse?Scenario=Scenario_Farmhouse_Checkpoint_Security"
echo "game port $GAME_PORT ,query port $QUERY_PORT, rcon port $RCON_PORT, server name $SERVER_NAME"
if [ "$GSLT" != "foo" ]; then
echo "community experience enabled, easy anti cheat enabled"
/opt/insurgency/Insurgency/Binaries/Linux/InsurgencyServer-Linux-Shipping $strMap?MaxPlayers=$MAX_PLAYERS \
-Port=$GAME_PORT -QueryPort=$QUERY_PORT -hostname="$SERVER_NAME" \
-GSLTToken=$GSLT -GameStats \
-log -MapCycle=$MAP_LIST $@
else
/opt/insurgency/Insurgency/Binaries/Linux/InsurgencyServer-Linux-Shipping $strMap?MaxPlayers=$MAX_PLAYERS \
-Port=$GAME_PORT -QueryPort=$QUERY_PORT -hostname="$SERVER_NAME" \
-log -MapCycle=$MAP_LIST -NoEAC $@
fi
fi