File: phone_log

package info (click to toggle)
statserial 1.1-18
  • links: PTS
  • area: main
  • in suites: potato
  • size: 76 kB
  • ctags: 13
  • sloc: ansic: 121; makefile: 50; sh: 10
file content (18 lines) | stat: -rwxr-xr-x 462 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash
#
# This script uses statserial to check the Ring Indicator signal of a
# modem. If the phone rings, it displays a message.
#
while true
do
  let ringing="`statserial -d /dev/modem` & 128"
  if [ $ringing != 0 ]
  then
    # can either send message to standard out
    echo -e "\a(`date`) Incoming Telephone Call"
    # or send mail
    # echo "Incoming phone call detected." | mail -s "Incoming Phone Call" `whoami`
    sleep 10
  fi
  sleep 1
done