Re: [SLUG] Shell script calling shell script

From: Chuck Hast (wchast@gmail.com)
Date: Fri Nov 19 2004 - 20:24:00 EST


On Fri, 19 Nov 2004 17:52:53 -0500 (EST), Eben King
<eben1@tampabay.rr.com> wrote:
> On Fri, 19 Nov 2004, Chuck Hast wrote:
>
>
>
> > On Fri, 19 Nov 2004 16:28:32 -0500 (EST), Eben King
> > <eben1@tampabay.rr.com> wrote:
> > > On Fri, 19 Nov 2004, Kwan Lowe wrote:
> > >
> > >
> > >
> > > > > If the sections are related, then what you might want to do is something
> > > > > like
> > > > >
> > > > > for subsystem in foo bar baz quux ; do
> > > > > $subsystem &
> > > > > usleep 100000 # optional
> > > > > done
> > > > >
> > > > > Nice and short, and you're assured that you call the subsystems in the
> > > > > same way. Easy to add/delete subsystems, too.
> > > >
> > > > Instead of a sleep, you may want to use "wait" instead. It will pause the
> > > > script until the sub returns.
> > >
> > > Will that have any effect with a "&"? If all of the subsystems start and
> > > then return control, you're right; "wait" is better than "usleep".
> >
> > Looked up sleep and wait in O'Reilly's Linux in a Nutshell,
>
> Ah, but I mentioned "usleep":
>
> USLEEP(1) USLEEP(1)
>
> NAME
> usleep - sleep some number of microseconds
>
> SYNOPSIS
> usleep [number]
>
> Good for when you want to pause for a non-integral number of seconds.

My error mis-read (read mental error correction protocol) the -U-....
But it is there, and the command is indeed there, but not in the book... Ohh
well so much for that.

>
> > I am going to add a few more as I seem to get hangups at times and I
> > see things happening when they should not be. So I think I need to slow
> > things down a bit here and there.
> >
> > Here is the start up file I am talking about, it is started up in rc5.d,
> > it was originally called as S04ax25, I changed it to S99ax25 so it would
> > be the last thing on the list to start, which helped but there are still
> > things that appear to be spinning up when it does start up,
>
> rc.local
>
> > I have added some sleeps in there but I think I need to add more.
>
> > ----------- Begin AX25-UP start up script ---------------------
> > #!/bin/bash
> > # Version = ax25-config-0.3.3
> > sleep 20
>
> Long sleep. What happens here?
That one was added by the ax25.conf program that creates the file. I am not
sure why.

>
> > # Start6pac0
> > # 6pack-Modul einbinden
> > modprobe ax25; modprobe 6pack; modprobe mkiss; insmod rose
>
> "insmod"? I don't think that'll work unless "rose" happens to be in $PWD .

The german ham that did the kernel did not put it in there so I have to
insmod it so it will run. One day i will redo the kernel and add it properly.
>
> > sleep 1
>
I
> What are you waiting for?

Kept on seeing problems and figured I would try that first and make sure
that the insmod is done, seems to have cured the problem of not recognizing the
rose interface when called below.
>
>
>
> > # StartKiss
> > #/usr/sbin/kissattach /dev/ptyz0 0 44.1.1.1
> > #/usr/sbin/mkiss -c -l /dev/ttyUSB0 /dev/ttyz0
> > #/usr/sbin/kissparms -p 0 -r 128 -s 10 -l 20 -t 60
> > #echo 100 > proc/sys/net/ax25/ax0/t1_timeout
> > #echo 30 > /proc/sys/net/ax25/ax0/t2_timeout
> > #echo 30000 > proc/sys/net/ax25/ax0/t3_timeout
> > #echo 10 > proc/sys/net/ax25/ax0/maximum_retry_count
> > #echo 4 > proc/sys/net/ax25/ax0/standard_window_size
> > #echo 256 > proc/sys/net/ax25/ax0/maximum_packet_length
> > # EndKiss0
>
> Did they insert the "#"s or did you? I'm not familiar with ax25, so I'll
> assume that doesn't affect the other connection(s).

I octothorped those out (that is why I want to do this as modules I just
octorhorp the call to the separate script out instead of having to do the
uglyness above.
If it just did
/etc/ax25/scripts/startkiss0
Then all I would have to do to remove that one is octothorp that line not
all of the buggers above.

>
> > # Attach AXIP Port
> > /usr/sbin/kissattach -m 1580 /dev/ptyq0 9 127.0.0.1
> > sleep 2
>
> Ditto: what are you waiting for?
Same thing it seemed to need some time to get this done properly and the
sleep appears to have cured some other problems when some other stuff
below tries to use that port

-- 
Chuck Hast 
To paraphrase my flight instructor;
"the only dumb question is the one you DID NOT ask resulting in my going
out and having to identify your bits and pieces in the midst of torn
and twisted metal."
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 17:45:41 EDT