Re: [SLUG] Shell script calling shell script

From: Chuck Hast (wchast@gmail.com)
Date: Fri Nov 19 2004 - 17:03:23 EST


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,
----------- Index --------------------
Wait -- See Sleep pp nn

Sleep

Sleep <amount> |units|
Wait a specified <amount> of time before executing another command.
The default for |units| is seconds
Time Units
s Seconds
m Minutes
h hours
d days

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, I have added some
sleeps in there but I think I need to add more.

Some of this was generated by a installer, the installer "speaks" german
so parts of the comments are in german, I have added a lot to it once I
saw how the installer set things up.

----------- Begin AX25-UP start up script ---------------------
#!/bin/bash
# Version = ax25-config-0.3.3
sleep 20
#
# Start6pac0
# 6pack-Modul einbinden
modprobe ax25; modprobe 6pack; modprobe mkiss; insmod rose
sleep 1
#
# Port 0 Configuration
# 6pack-Ger� an /dev/ttyS0 als Port "6pac0" anbinden
/usr/sbin/spattach /dev/ttyS0 8 44.1.1.1
#
# Parameter einstellen: P=128, W=10, txtail 20 TX-Delay=60
/usr/sbin/kissparms -p 8 -r 128 -s 10 -l 20 -t 60
echo 100 > /proc/sys/net/ax25/sp0/t1_timeout
echo 30 > /proc/sys/net/ax25/sp0/t2_timeout
echo 0 > /proc/sys/net/ax25/sp0/t3_timeout
echo 10 > /proc/sys/net/ax25/sp0/maximum_retry_count
echo 4 > /proc/sys/net/ax25/sp0/standard_window_size
echo 256 > /proc/sys/net/ax25/sp0/maximum_packet_length
# End6pac0
#
# Port 1 Configuration
# 6pac1 on /dev/ttyUSB0
/usr/sbin/spattach /dev/ttyUSB0 0 44.1.1.1
/usr/sbin/kissparms -p 0 -r 128 -s 10 -l 20 -t 200
echo 100 > /proc/sys/net/ax25/sp1/t1_timeout
echo 30 > /proc/sys/net/ax25/sp1/t2_timeout
echo 0 > /proc/sys/net/ax25/sp1/t3_timeout
echo 10 > /proc/sys/net/ax25/sp1/maximum_retry_count
echo 4 > /proc/sys/net/ax25/sp1/standard_window_size
echo 245 > /proc/sys/net/ax25/sp1/maximum_packet_length
# End 6pac1
#
# 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
#
# Attach AXIP Port
/usr/sbin/kissattach -m 1580 /dev/ptyq0 9 127.0.0.1
sleep 2
#
# Start AXIP daemon
/usr/sbin/ax25ipd &
#
# End AXIP
#
# Start NetRom Stuff
#
echo -n " NET/ROM: "
nrattach -i 44.1.1.1 netrom
# Start Net/Rom daemon
/usr/sbin/netromd -i
#
# Start Rose stuff
#rsattach -i 44.1.1.1 rose0
#rsattach -i 44.1.1.1 rose1
#
# Logins von au�n erm�lichen
#/usr/sbin/ax25d &
#echo $! > /var/run/ax25d.pid
#
# Start mheard daemon
/usr/sbin/mheardd
# Start AX25 routing daemon
#/usr/sbin/ax25rtd &
#echo $! > /var/run/ax25rtd.pid
#
# DAMA einschalten 0=aus 2=DAMA
#echo 2 > /proc/sys/net/ax25/sp0/protocol
# Monitor auf Terminal 11 starten
/usr/bin/listen -artc > /dev/tty11 &
#echo $! > /var/run/listen.pid
# Monkt fuer Monitor Monkt starten
#monktd &
# EndARNM
#sleep 10
#
# Start FPAC
/usr/sbin/fpac.sh
# EndFPAC
#
# End script
--------------------------------- The END -------------------

-- 
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:05 EDT