/
script.sh
39 lines (38 loc) · 1.3 KB
/
script.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
set -e
set -x
echo "Starting provisioning"
echo "Setting up i386 architecture"
sudo dpkg --add-architecture i386 -y
echo "i386 architecture installed"
echo "Installing required packages"
sudo apt-get update -y
if [ $(dpkg-query -W -f='${Status}' lib32gcc1 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
sudo apt-get install lib32gcc1 -y
fi
if [ $(dpkg-query -W -f='${Status}' lib32stdc++6 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
sudo apt-get install lib32stdc++6 -y
fi
if [ $(dpkg-query -W -f='${Status}' libcurl4-gnutls-dev:i386 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
sudo apt-get install libcurl4-gnutls-dev:i386 -y
fi
echo "Packages have been installed"
echo "Configurating user"
#sudo useradd -m steam
#sudo chmod a+rw `tty`
sudo su - steam
sudo mkdir /home/steam/steamcmd
cd /home/steam/steamcmd
echo "Downloading steam"
wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
echo "Extracting steam"
tar -xvzf steamcmd_linux.tar.gz
echo "Install & configure steam"
./steamcmd.sh steamcmd +login anonymous +force_install_dir /home/steam/steamapps/DST +app_update 343050 +validate +quit
echo "Quit from steam console"
echo "Check out folder to server"
cd /home/steam/steamapps/DST/bin/
echo "Runs DST Server"
su -c ./dontstarve_dedicated_server_nullrenderer -s /bin/sh steam