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

Dave <[email protected]>
Newsgroups gmane.user-groups.linux.ottawa.general
Message-ID <[email protected]>
Thank you for all that Joe.
Taking your earlier comments to heart, I'll "tidy" the script with 
indenting of the if-fi areas.
First I'll see if I'm happy with the sanity  of the13 if-fi entries.

That variable - IIRC it required defining or else I bombed on unknown 
stuff, and unary whatever. So, I had used the on-disc value, _knowing_ 
it would be "dunnie" :-[
I never intended (and still don't) that the script would be running for 
longer - it was/is to be a one-shot affair (even with crontab * * * * *).

TTYL;
DaveR

Joe Burpee wrote:
> 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.