Search the Community

Showing results for tags 'restart'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] PS4
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Hot Lava
    • [Hot Lava Beta] - General Discussion
    • [Hot Lava Beta] - Suggestions and Feedback
    • [Hot Lava Beta] - Bug Tracker
    • [Hot Lava Beta] - Strats and Records
    • [Hot Lava Beta] - Developer Log
    • Hot Lava Beta Latest Update
  • Griftlands
    • [Griftlands] - General Discussion
  • Don't Starve
    • Don't Starve FAQ
    • [Don't Starve: Pocket Edition] iOS / Android
    • [Don't Starve] General Discussion
    • [Don't Starve] Mods and tools
    • [Don't Starve] Art, Music & Lore
    • [Don't Starve] Suggestions and Feedback
    • [Don't Starve] Videos
    • [Don't Starve] Bug Tracker
    • [Don't Starve] Trading
    • [Don't Starve] Testing Discussion (archive)
  • Klei Entertainment Games
    • Eets Munchies
    • [Invisible, Inc.] General Discussion and Strategies
    • Mark of the Ninja
    • Shank
  • Other Stuff
    • The Off-Topic Area
    • Forum Upgrade

Categories

  • Don't Starve
    • Custom Character and Skins
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included - [Early Access]
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] PS4
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included - [Early Access]
  • Don't Starve: Hamlet - Early Access
  • Don't Starve Together
  • [PS4] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Shipwrecked
  • Hot Lava - [Open Beta]

Categories

  • Hot Lava - Beta Reports


Biography


Location


Interests


Occupation


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together


Oxygen Not Included

Found 1 result

  1. Hello everyone! Some time ago i started working on a script that fully automates the procedure of running and updating a server. The following script is my as of now final result (fixes may occur if needed). It does the following in its current configuration: Update the game Start the Caves Start the Master Wait for 20 minutes Check for an update. If an update is not needed, go to 4. is needed, go to 6. Announce on the server that an update is needed and that the server will restart in 15 minutes Repeat the warning 5 and 1 minute/s before the shutdown so every player can plan ahead Shut down the Caves Shut down the Master Go to 1. You can also force a shutdown using the Ctrl + C command in the terminal window of the running script. The log gets hidden away. If you need to check it, you must open the server_log.txt files. If you followed this guide here, you should have everything correctly in place for the script to work. Remember to change your_cluster_name to the folder name of your cluster in ~/.klei/DoNotStarveTogether. For this script to work you need screen installed on your system, but chances are you already have it. #!/bin/bash #### User Variables; Set your preferences #### CLUSTER_NAME="your_cluster_name" MASTER_NAME="Master" CAVE_NAME="Caves" CHECK_UPDATE_FREQ="20m" DONT_STARVE_CLUSTER_DIR="$HOME/.klei/DoNotStarveTogether" DONT_STARVE_DIR="$HOME/dontstarvetogether_dedicated_server" #### Script Variables; Do not modify #### lv_file="/tmp/${CLUSTER_NAME}_latest_version" DONT_STARVE_BIN="./dontstarve_dedicated_server_nullrenderer" #### Functions #### function needs_update() { klei_url="https://forums.kleientertainment.com/game-updates/dst/" latest_version=$(curl -s $klei_url | grep -Po "\s+\d{6,}$" | head -n 1) if [[ -e $lv_file ]]; then current_version=$(head -n 1 $lv_file) fi echo $latest_version > $lv_file if [[ $current_version -lt $latest_version ]]; then echo "1" else echo "-1" fi } function exists() { if [[ ! -e $1 ]]; then failed "File/Dir not found: $1" fi } function failed() { echo "Error: $@" >&2 exit 1 } function command_m() { screen -S ${CLUSTER_NAME}_${MASTER_NAME} -p 0 -X stuff "$1^M" } function command_c() { screen -S ${CLUSTER_NAME}_${CAVE_NAME} -p 0 -X stuff "$1^M" } function stop_server() { command_m 'c_announce("Server stopped by force! Shutting down!")' sleep "2s" command_c 'c_shutdown()' command_m 'c_shutdown()' # The server gets 20 seconds to shutdown normally # sleep "20s" # Should the server still be running; Kill it # if screen -list | grep -q ${CLUSTER_NAME}; then command_c "^C" command_m "^C" fi exit 1 } #### Script routine #### trap stop_server 2 # Check for missing files # exists "$DONT_STARVE_CLUSTER_DIR/$CLUSTER_NAME/cluster.ini" exists "$DONT_STARVE_CLUSTER_DIR/$CLUSTER_NAME/cluster_token.txt" exists "$DONT_STARVE_CLUSTER_DIR/$CLUSTER_NAME/$MASTER_NAME/server.ini" exists "$DONT_STARVE_CLUSTER_DIR/$CLUSTER_NAME/$CAVE_NAME/server.ini" # Check for an update beforehand # needs_update 2>&1 >/dev/null while [[ true ]]; do # Force an update # mv "$DONT_STARVE_DIR/mods/dedicated_server_mods_setup.lua" "$DONT_STARVE_DIR/mods/dedicated_server_mods_setup.lua.bak" echo "Start updating the game." steamcmd +force_install_dir $DONT_STARVE_DIR +login anonymous +app_update 343050 validate +quit mv "$DONT_STARVE_DIR/mods/dedicated_server_mods_setup.lua.bak" "$DONT_STARVE_DIR/mods/dedicated_server_mods_setup.lua" # Check for DST binary # exists "$DONT_STARVE_DIR/bin" # Run Shards # cd "$DONT_STARVE_DIR/bin" echo "Starting ${CAVE_NAME}." screen -d -m -S ${CLUSTER_NAME}_${CAVE_NAME} $DONT_STARVE_BIN -cluster $CLUSTER_NAME -shard $CAVE_NAME echo "Starting ${MASTER_NAME}." screen -d -m -S ${CLUSTER_NAME}_${MASTER_NAME} $DONT_STARVE_BIN -cluster $CLUSTER_NAME -shard $MASTER_NAME # Checks for updates # while [[ true ]]; do # Check for updates every 20 minutes # sleep $CHECK_UPDATE_FREQ # If there is an update, we will start the shutdown process # result=$(needs_update) if [[ $result -gt 0 ]]; then echo "The server needs an update. Will restart in 15 minutes." command_m 'c_announce("Klei released an update! The server restarts in 15 minutes!")' sleep "10m" command_m 'c_announce("Klei released an update! The server restarts in 5 minutes!")' sleep "4m" command_m 'c_announce("Klei released an update! The server restarts in 1 minute!")' sleep "1m" command_m 'c_announce("Restarting now!")' command_c 'c_shutdown()' command_m 'c_shutdown()' break fi done # We wait till the game shuts down # echo "Waiting for shards to shut down." while [[ true ]]; do if ! screen -list | grep -q ${CLUSTER_NAME}; then echo "Shards are down. Restarting." break fi done done