Skip to content

Instantly share code, notes, and snippets.

@Dewb
Created November 21, 2016 22:31
Show Gist options
  • Save Dewb/7c8468c933e3327391bb3cd63eab8470 to your computer and use it in GitHub Desktop.
Save Dewb/7c8468c933e3327391bb3cd63eab8470 to your computer and use it in GitHub Desktop.
Starbound server utilities
#!upstart
description "Starbound Game Server"
# Start the job
exec su -l starbound -c 'cd /home/starbound/server/linux; ./starbound_server'
# Start on boot
start on filesystem and net-device-up IFACE=lo
# Restart the process if it dies
respawn
# Give up if restart occurs 10 times in 90 seconds
respawn limit 10 90
#!/bin/bash
# stop, update, and restart starbound
# in an environment where the script is executed as root, but the server runs under user starbound
# tails log after restart to confirm server comes up, hit ctrl-c to exit
read -p "Steam User: " -e user
read -p "Steam Password: " -e pass
sudo systemctl stop starbound
sudo -u starbound -H sh -c "cd ~ && ./steamcmd/steamcmd.sh +login $user $pass +force_install_dir ~/starbound_server +app_update 211820 +exit"
sudo systemctl start starbound
sudo journalctl -fu starbound
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment