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
| $ apt update $ apt upgrade -y $ apt-get install software-properties-common -y $ add-apt-repository multiverse $ dpkg --add-architecture i386 $ apt update $ apt install libstdc++6 libgcc1 libcurl4-gnutls-dev:i386 lib32z1 lib32stdc++6 -y
$ mkdir ~/steamcmd $ cd ~/steamcmd $ wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz $ tar -xvzf steamcmd_linux.tar.gz
$ ./steamcmd.sh steam> force_install_dir ../dontstarvetogether_dedicated_server steam> login anonymous steam> app_update 343050 validate steam> quit
$ mkdir -p ~/.klei/DoNotStarveTogether/Cluster_1 $ cd ~/.klei/DoNotStarveTogether/Cluster_1
$ echo "xxxxxx" > cluster_token.txt
$ echo "xxxxxx" > adminlist.txt
$ cat ~/.klei/DoNotStarveTogether/Cluster_1/Master/modoverrides.lua
$ vim ~/dontstarvetogether_dedicated_server/mods/dedicated_server_mods_setup.lua ServerModSetup("1185229307") ServerModSetup("1207269058") ......
$ cd ~ $ vim boot.sh
steamcmd_dir="$HOME/steamcmd" install_dir="$HOME/dontstarvetogether_dedicated_server" cluster_name="Cluster_1" dontstarve_dir="$HOME/.klei/DoNotStarveTogether"
function fail() { echo Error: "$@" >&2 exit 1 }
function check_for_file() { if [ ! -e "$1" ]; then fail "Missing file: $1" fi }
cd "$steamcmd_dir" || fail "Missing $steamcmd_dir directory!" check_for_file "steamcmd.sh" check_for_file "$dontstarve_dir/$cluster_name/cluster.ini" check_for_file "$dontstarve_dir/$cluster_name/cluster_token.txt" check_for_file "$dontstarve_dir/$cluster_name/Master/server.ini" check_for_file "$dontstarve_dir/$cluster_name/Caves/server.ini" check_for_file "$install_dir/bin" cd "$install_dir/bin" || fail run_shared=(./dontstarve_dedicated_server_nullrenderer) run_shared+=(-console) run_shared+=(-cluster "$cluster_name") run_shared+=(-monitor_parent_process $$) run_shared+=(-shard) "${run_shared[@]}" Caves | sed 's/^/Caves: /' & "${run_shared[@]}" Master | sed 's/^/Master: /'
$ chmod u+x boot.sh $ nohup ./boot.sh > root.log 2>&1 & $ cat root.log | grep connected Master: [00:01:10]: World xxx is now connected
|