Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/lib/fax/receiverc – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
spool=/mail/faxqueue
3
recipients=/mail/faxqueue/faxrecipients
4
 
5
# run mail as if we're on fs
6
rm /srv/fs
7
9fs fs
8
bind -c /n/fs/mail/faxqueue /mail/faxqueue
9
 
10
#
11
# Arguments should be
12
#	time Y|N pages [ftsi]
13
#
14
switch($#*){
15
 
16
case 4
17
	#
18
	# Check for the NYT. It's 9 pages from 'Via Fax             '.
19
	#
20
	nyt=false
21
	if(~ $2 Y && {~ $4 'Via Fax             '}){
22
		switch(`{date|sed 's/ .*//'}){
23
		case Mon Tue Wed Thu Fri
24
			hour=`{date|sed 's/.* ([0-9][0-9]):.*/\1/'}
25
			if(test $3 -gt 7 -a '(' $hour -lt 7 -o $hour -ge 21 ')')
26
				nyt=true
27
		case *
28
			if(test $3 -gt 7)
29
				nyt=true
30
		}
31
	}
32
	switch($nyt){
33
 
34
	case true
35
		to=`{seq 0 1 $3}
36
		for(i in `{seq 2 1 $3}){
37
			switch($i){
38
 
39
			case ?
40
				ext=00$i
41
			case ??
42
				ext=0$i
43
			case ???
44
				ext=$i
45
			}
46
			cp $spool/$1.$ext /n/fs/lib/nyt/nyt.$to($i)
47
		}
48
		cp $spool/$1.1 /n/fs/lib/nyt/nyt.$3
49
		rm -f $spool/$1.*
50
	case *
51
		{echo $*; echo FAX: page -w $spool/$1.'*'} | mail `{cat $recipients}
52
	}
53
case 3
54
	{echo $*; echo FAX: page -w $spool/$1.'*'} | mail `{cat $recipients}
55
case *
56
	{echo $*; echo FAX: page -w $spool/$1.'*'} | mail jmk
57
}
58
exit 0