Guest User

Auto Linux installer for arma 3 epoch server

a guest
Aug 19th, 2015
1,649
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.95 KB | None | 0 0
  1. #!/bin/bash
  2. clear
  3.  
  4. echo "################################################################################################"
  5. echo "# This scriptl will install an Arma 3 Epoch Server on a debian based linux distribution        #"
  6. echo "# A user called steam will be created and all necessary files will be downloaded.              #"
  7. echo "# This script was tested by me. However i am not responsibly for any problems that may occour. #"
  8. echo "#                                                                                              #"
  9. echo "# Script by Flow, www.pixelkiller.de                                                           #"
  10. echo "################################################################################################"
  11. echo
  12.  
  13. echo
  14. echo
  15. echo "ATTENTION: If you already have a user called steam it will be deleted (home dir also!!!!)"
  16. echo
  17. echo
  18. echo -n "If you did understand and want to continue, type 'understand' : "
  19. read answer
  20. if echo "$answer" | grep -iq "understand" ;then
  21.         echo
  22.         echo "Start installing required files"
  23.         echo "==============================="
  24. else
  25.     exit
  26. fi
  27. echo
  28. echo
  29. echo -n "Please enter your steam username: "
  30. read steamuser
  31. echo -n "Please enter your steam password: "
  32. read steampass
  33. echo
  34. echo
  35.  
  36. apt-get install lib32gcc1 gcc-multilib unzip redis-server screen -y
  37.  
  38.  
  39. if id -u "steam" >/dev/null 2>&1; then
  40.         echo -n "User steam already exists. Removing user and homedir for fresh start"
  41.         rm -rf /home/steam/*
  42.         deluser steam --remove-home
  43.         adduser steam --quiet --gecos GECOS --disabled-password --disabled-login
  44. else
  45.         echo "User steam will be created. Installing server to /home/steam."
  46.         echo "Do not forget to set a password for the user steam. Currently login is disabled"
  47.         echo "You have to login as root and switch to steam user when starting arma3server"
  48.         adduser steam --quiet --gecos GECOS --disabled-password --disabled-login
  49. fi
  50.  
  51. echo
  52.  
  53. echo "Downloading steamcmd"
  54.  
  55. cd /home/steam
  56. mkdir epoch
  57. mkdir steamcmd && cd steamcmd
  58. wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz --quiet --no-check-certificate && tar xzf steamcmd_linux.tar.gz && rm -f steamcmd_linux.tar.gz
  59. ./steamcmd.sh +quit
  60.  
  61. echo "Installing Arma 3"
  62. echo
  63. ./steamcmd.sh +login $steamuser $steampass +force_install_dir /home/steam/epoch +app_update 233780 validate +quit
  64.  
  65. echo "Installing Epoch"
  66. echo
  67. ./steamcmd.sh +login $steamuser $steampass +force_install_dir /home/steam/epoch +workshop_download_item 107410 421839251 +quit
  68.  
  69. mv /home/steam/steamcmd/steamapps/workshop/content/107410/421839251 /home/steam/epoch/@epoch
  70.  
  71. clear
  72.  
  73. cp -f /home/steam/epoch/@epoch/Keys/*.bikey /home/steam/epoch/keys
  74.  
  75. mkdir /home/steam/tmpserverfiles
  76.  
  77. cd /home/steam/tmpserverfiles
  78.  
  79. echo "Installing Epoch Hive files"
  80. echo
  81.  
  82. wget https://github.com/EpochModTeam/Epoch/archive/master.zip --quiet --no-check-certificate && unzip master.zip
  83.  
  84. cp -Rf /home/steam/tmpserverfiles/Epoch-master/Server_Install_Pack/* /home/steam/epoch/
  85.  
  86. rm -rf /home/steam/tmpserverfiles
  87.  
  88. HIVEINI=`cat /home/steam/epoch/@epochhive/EpochServer.ini`
  89. EPOCHPASS=`date +%s | sha256sum | base64 | head -c 32 ; echo`
  90. NEWHIVEINI=`echo "$HIVEINI" | sed -e 's/foobared/'$EPOCHPASS'/g'`
  91. STARTSCRIPT=`cat /home/steam/epoch/epoch_linux_startscript.sh | sed -e 's:'/home/arma3':'/home/steam/epoch':g'`
  92.  
  93. echo "$STARTSCRIPT" > /home/steam/epoch/epoch_linux_startscript.sh
  94.  
  95. cp /etc/redis/redis.conf /etc/redis/redis.conf.bak
  96.  
  97. echo "requirepass $EPOCHPASS" >> /etc/redis/redis.conf
  98.  
  99. echo "$NEWHIVEINI" > /home/steam/epoch/@epochhive/EpochServer.ini
  100.  
  101. /etc/init.d/redis-server restart
  102.  
  103. chmod +x /home/steam/epoch/epoch_linux_startscript.sh
  104.  
  105. mkdir /home/steam/epoch/logs
  106.  
  107. mv /home/steam/epoch/@epoch/Addons /home/steam/epoch/@epoch/addons
  108.  
  109. chown -R steam:steam /home/steam
  110.  
  111. clear
  112. echo "ALL DONE, DO NOT FORGET TO EDIT YOUR CONFIGS. I ALREADY CONFIGURED REDIS FOR YOU"
  113.  
  114. exit
Add Comment
Please, Sign In to add comment