Results 1 to 2 of 2
I created this script to monitor for ppp0 in ifconfig response. When I NOHUP 'd it (modmCk) in the script which starts ppp-go it worked well until the alarm went ...
- 05-22-2011 #1Linux User
- Join Date
- Mar 2008
- Posts
- 287
Modem monitor
I created this script to monitor for ppp0 in ifconfig response. When I NOHUP 'd it (modmCk) in the script which starts ppp-go it worked well until the alarm went off. I could not KILL the modmCK. I ended up rebooting.
Can someone suggest how I can start modmCK from the one I am using to start ppp-go (Slackware) and be able to leave the startup script while leaving this script running AND be able to kill it?
while :
do
sleep $1s
ifconfig | egrep -q ppp0
if [ "$?" == "1" ]
then while :
do
play /opt/SECURE/KISMET/kismet-2010-01-R1/wav/gpslost.wav 2>/dev/null
sleep 2s
done
fi
done
- 06-07-2011 #2Linux User
- Join Date
- Mar 2008
- Posts
- 287
Modem monitor
There is a typo following sleep and before 1s which was the problem.
For antiquated dialup users this may help:
Code:######################################################################## # mdmCkr.sh Will alert user when modem linkage fails by sounding # 4 warning bells 4 times. # If run: nohup ./mdmCkr.sh & # The nohup.out file is deleted then this script is killed. ######################################################################## echo -e "Modem Checker Active (Job: $$)" knt=0 while : do sleep 5s # Look for point-to-point feature (ppp0) /sbin/ifconfig | egrep -q ppp0 if [ "$?" == "1" ] then for i in 1 2 3 4 do # Play warning 4 bells if pt-2-pt is lost play /opt/SECURE/KISMET/kismet-2010-01-R1/wav/gpslost.wav \ 2>/dev/null sleep 2s # Bell separation time done # Display job number with each warning echo -e "Modem Link Failed (Job: $$)" knt=`expr $knt + 1` fi # After 4 warnings (16 bells) quit if [ $knt -gt 3 ] then rm -f nohup.out # Remove nohup.out if run from background kill $$ # Kills itself if run in background exit fi doneLast edited by clickit; 06-08-2011 at 03:10 AM.


Reply With Quote