Re: Blacklisted Shell Script? --- SOLVED ---

Joe Burpee <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
On Sun, Jul 05, 2009 at 22:06:48 -0400, Dave wrote:
> I've  added the line
>
> echo "foolsafe"> /home/whacker/IP-Update/running_flag
>
> immediately ahead of
>
> running_flag=`cat /home/whacker/IP-Update/running_flag`
>
> at the beginning of the script to prevent a reoccurrence of this.
 
Sounds appealing Dave, but unfortunately this seems to defeat your
mechanism for determining whether the script is already running.

Maybe the safest way would be to insert something simple like the
following in the "else" block for the main "if":

echo "Script bypassed based on contents of file 'running_flag'."

This may not be ideal for a cron job.  Instead you might want to just
add a meaningful comment near the top of the script.

Anyway you shouldn't feel bad about any of this Dave.  There are
more sophisticated ways of dealing with these things, but all kinds of
fancy software gets fouled up by stale or corrupt data.

Glad I was able to help you find the problem.

Joe

-- 
OCLUG general discussion list
[email protected]
http://oclug.on.ca/mailman/listinfo/oclug
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.