leeee
asked on
How to test if a modem is on/off inside a script?
Hi,
I need to test inside a shell script (UX10.20) is a modem is on/off. If it is off, I have to do some actions (Send an email...).
That script will b excuted via cron, every minute.
1. What is the command to check the modem on/off? (Is it cu -l /dev/... ? )
How do I do it inside a script??
2. If u can, provide me the full script. It has to do a very simple action:
Check if the modem is active (On electricity...), if not send an email to some people.
Many thanks, leee
I need to test inside a shell script (UX10.20) is a modem is on/off. If it is off, I have to do some actions (Send an email...).
That script will b excuted via cron, every minute.
1. What is the command to check the modem on/off? (Is it cu -l /dev/... ? )
How do I do it inside a script??
2. If u can, provide me the full script. It has to do a very simple action:
Check if the modem is active (On electricity...), if not send an email to some people.
Many thanks, leee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:
- Answered by bira
Please leave any comments here within the next 7 days
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
tfewster
Cleanup Volunteer
I will leave a recommendation for this question in the Cleanup topic area as follows:
- Answered by bira
Please leave any comments here within the next 7 days
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !
tfewster
Cleanup Volunteer
per recommendation
SpideyMod
Community Support Moderator @Experts Exchange
SpideyMod
Community Support Moderator @Experts Exchange
I don't have a system handy at the moment to see if cu has any standard output. If so, maybe:
test=`cu -l /dev/tty1 > /dev/null 2>&1`
If not, ignore my comment.