User Name:


Forgot your password?
Vote for Us!
Nov 28, 2018, 10:10 am
By Keirath
First Immortal
Oct 12, 2018, 12:02 pm
By GatewaySysop
Bug in do_climb( )
Jun 5, 2018, 5:31 pm
By joeyfogas
question on overland code
May 31, 2018, 10:03 am
By joeyfogas
KaVir's Protocol Snip
May 15, 2018, 7:57 pm
By joeyfogas
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 17
Newest Member
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » ./startup
Forum Rules | Mark all | Recent Posts

< Newer Topic :: Older Topic > Need some help tweaking it to work

Pages:<< prev 1 next >>
Post is unread #1 Jan 16, 2006, 10:28 am
Go to the top of the page
Go to the bottom of the page


JoinedJan 15, 2006

#! /bin/bash -f

# Set the port number.
set port = 4000
if ( "$1" != "" )
	set port ="$1"

# Change to area directory.
cd ../area

# Set limits.
ulimit -c unlimited
ulimit -s unlimited
if ( -e shutdown.txt )
	rm -f shutdown.txt
while ( 1 )
    # If you want to have logs in a different directory,
    #   change the 'set logfile' line to reflect the directory name.
    set index = 1000
    while ( 1 )
		set logfile = ../log/$index.log
		if ( ! -e $logfile )
		@ index++

    # Record starting time
    date > $logfile
    date > ../area/boot.txt

    # Run SMAUG.
    # Check if already running
    set matches = `netstat -an | grep ":$port " | grep -c LISTEN`
    if ( $matches >= 1 ) then
        # Already running
        echo Port $port is already in use.
        exit 0
    ../src/smaug $port >&! $logfile

    # Restart, giving old connections a chance to die.
    if ( -e shutdown.txt ) then
	rm -f shutdown.txt
	exit 0
    sleep 5s


Ok. I'm fairly sure for the most part this thing will work, minus this simple error:

./startup: line 54: syntax error: unexpected end of file

That, in other words, means that end isn't a good enough, ahem, end to the file. I tried putting return in (was worht a shot...), and got the same error on the next line. I'm stumped as to what to do. Got Learning the bash shell (O'Reily) sitting on my desk, but it doesn't seem to have anything in there pertaining to ending a shell script, but for the most part I think this works.
I've convered everything over to bash from what I can tell, and it seems like it would work (I've either run the command, or I've found an info page on it), so, yeah. Anyone else who uses the bash shell and would like to use the startup script and can fix this tiny error, hope this helps
Post is unread #2 Feb 14, 2006, 11:27 pm
Go to the top of the page
Go to the bottom of the page

Dace K

JoinedFeb 14, 2006

Should work. Sure you have a newline after the end?
Pages:<< prev 1 next >>