Alright, I am pretty new to Linux but I am going to learn it never the less even if it kills me. Currently I am trying to run a C based program and am having trouble with the startup.startup file (the file which boots up the program. What it is doing, it is removing the shutdown file and moving it to a log (I think) but not providing a replacement. Here is the startup code:
Code:#!/bin/bash # Written by Furey. # With additions from Tony and Alander. # Set the port number. port=4204 if (test "$1" != "" ) then port="$1" fi # Change to area directory. cd ../area # Set limits. if [ test -e shutdown.txt ]; then rm -f shutdown.txt fi while [ 1 ] do index=1000 while [ 1 ] do logfile=../log/$index.log if (test ! -e $logfile ) then break fi index=`expr $index + 1` done # Run rom. # core dumping ../src/clands $port > $logfile 2>&1 # Restart, giving old connections a chance to die. if (test -e shutdown.txt ) then rm -f shutdown.txt mv shutdown.txt shutdown.old fi sleep 15 done
I think -e stands for empty unwritten to. On a successful shutdown, it writes to shutdown.txt and on an unsuccessful one it doesn't. During a reboot, we crashed thus its unwritten to and it deletes it (as it seems pointless to log an empty file. But still, it needs the next command and itís a mistake.
Don't know how close I am but if anyone can help me, I would appreciate a swift reply.
Well...somehow it works now...didn't do anything to it...I'm confused. I worked out that it removes the shutdown on a successful startup then rewrites it on shutdown but have no clue why it all works now.