File: answer_fax.sh

package info (click to toggle)
mgetty 1.2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,880 kB
  • sloc: ansic: 42,794; perl: 6,262; sh: 4,934; makefile: 1,506; tcl: 756; lisp: 283
file content (26 lines) | stat: -rw-r--r-- 706 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
#
# From: Sarantos Kapidakis <sarantos@ics.forth.gr>
# To: gert@greenie.muc.de
# Subject: Re: mgetty
#
# By the way, this is my fax-answer-now script (you can include it in
# the distribution as an example, if you want),
# which asks mgetty to answer pick up the phone, and if there is no
# mgetty running (it depends on my init level), it starts a single
# mgetty for answering this one call.
#
#!/bin/sh
sig=-USR1
port=${1:-ttyS1}
if pid=`cat /etc/mg-pid.$port 2>/dev/null` && kill $sig $pid  2>/dev/null
then
	:
else
	/usr/local/sbin/mgetty $port < /dev/null &
	echo "starting mgetty..."
	sleep 4
	pid=`cat /etc/mg-pid.$port`
	kill $sig $pid
fi
echo "sending mgetty, pid $pid, signal $sig..."