Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

BASH script for start/stop/update/backup TDSM


  • Please log in to reply
4 replies to this topic

#1 fanskapet

fanskapet

    Experienced Member

  • Members
  • PipPip
  • 36 posts
  • LocationSweden
  • Graphics Card:Intel HD Graphics 3000, AMD Radeon HD6750M 512MB
  • Operating System:Mac OS X 10.7 (Lion)
  • I like to play:All different types of games both classic cute C64 ones and bloody hardcore games.

Posted 28 April 2012 - 10:18 PM

Just thought it would be an idea to share my UNIX BASH script i've put toghether for my Terraria server (TDSM).
Besides MONO the script is using typical normal UNIX applications that should be included in most distrubutions such as Ubuntu.

The script is well suited to be scheduled in crontab for daily backups or used to start and stop the server at system startup.

I have only tested the script on my Mac OS X Server but it should work on any kind of UNIX system.

# Script name: terraria_server.sh
# Author: Tommy Frössman
#
# Requirements
#   - UNIX Operating System with terminal access.
#   - BASH (Bourne Again Shell) shell available.
#   - MONO (Microsoft.NET Framework) software installed.
#   - GNU screen software installed.
#   - GNU wget software installed.
#
# Changelog
#    2012-04-28
#   - install functionality.
#   - automatic configuration presets when installing.
#   - start/stop functionality.
#   - restart functionality.
#   - backup functionality (both offline and online).
#   - updating functionality.
#   - sending custom server commands functionality.
#   - show server statistics using the status server command.
#   - show running state of server.
#   - placing server engine in background using GNU Screen session.

http://users.kladhes...raria_server.sh

#2 julus

julus

    Veteran Member

  • Members
  • PipPipPipPipPip
  • 254 posts
  • LocationSlovakia
  • Graphics Card:AMD Radeon 6750M
  • Operating System:OS X 10.8 (Mountain Lion)
  • I like to play:MMORPG, Adventure, RPG, Strategy
Author

Posted 28 April 2012 - 11:21 PM

I suppose you should switch wget for curl. On Mac everything is installed by default except wget and mono, while mono can be easily instaled via dmg file, the wget needs to be compiled and installed manually or by macports.

autodetection of system can be done easily
something like
if [ $(uname) == "Darwin" ]
then
	WGET_COMMAND="curl -s "
else
	WGET_COMMAND="wget -q "
fi


#3 fanskapet

fanskapet

    Experienced Member

  • Members
  • PipPip
  • 36 posts
  • LocationSweden
  • Graphics Card:Intel HD Graphics 3000, AMD Radeon HD6750M 512MB
  • Operating System:Mac OS X 10.7 (Lion)
  • I like to play:All different types of games both classic cute C64 ones and bloody hardcore games.

Posted 29 April 2012 - 08:18 PM

feel free to update it :) it works perfectly on my env. since i use macports and wget :-)

#4 JmoolZZ

JmoolZZ

    Novice Member

  • Members
  • 5 posts
  • Graphics Card:Intel HD 3000 384MB
  • Operating System:Mac OS X 10.7 (Lion)

Posted 20 May 2013 - 03:28 AM

Any way that wget could be editted for the curl command?

#5 JmoolZZ

JmoolZZ

    Novice Member

  • Members
  • 5 posts
  • Graphics Card:Intel HD 3000 384MB
  • Operating System:Mac OS X 10.7 (Lion)

Posted 20 May 2013 - 01:44 PM

Actually forget that question, but does this actually work for running a Terraria server? It would be great if it did.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users