File: 10device_halted.diff

package info (click to toggle)
efax 1%3A0.9a-25
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 828 kB
  • sloc: ansic: 6,763; sh: 4,039; makefile: 80
file content (66 lines) | stat: -rw-r--r-- 1,761 bytes parent folder | download | duplicates (3)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From: DEXTARR <DEXTARR@freemail.hu>
Date: Mon, 23 Jan 2006 12:57:58 +0000
Subject: handle case when fax device is stopped (and so $logfile disappears)

--- efax-0.9a/fax	2005-10-28 14:46:29.000000000 +0200
+++ efax-0.9a/fax	2006-01-06 15:31:19.000000000 +0100
@@ -668,17 +668,21 @@
 	cd $FAXDIR ; 
 	case $? in 0) ;; *) echo "cannot cd to $FAXDIR" ; break ;; esac
 
-	n= ; for f in ${DEVN}.[0-9]* ; do logfile="$f" ; n=x$n ; done
+# if fax device is halted no infos are available
+	if [ ! -f ${DEVN}.stop ]
+	then 
+	    n= ; for f in ${DEVN}.[0-9]* ; do logfile="$f" ; n=x$n ; done
+
+	    case $n in 
+	    xx*) echo Warning: multiple logs for $DEV : ; ${LS} ${DEVN}.[0-9]* ;;
+	    esac
+
+	    case $logfile in 
+	    *\*) echo no fax answer process for device $DEV ; break ;;
+	    esac
 
-	case $n in 
-	xx*) echo Warning: multiple logs for $DEV : ; ${LS} ${DEVN}.[0-9]* ;;
-	esac
-
-	case $logfile in 
-	*\*) echo no fax answer process for device $DEV ; break ;;
-	esac
-
-	efaxpid=`echo $logfile | sed -e "s/${DEVN}\.//g"`
+	    efaxpid=`echo $logfile | sed -e "s/${DEVN}\.//g"`
+	fi
 
 	case $cmd in
 
@@ -695,6 +699,13 @@
 
 	stop)
 
+# if fax device is halted, just print message, no other infos are available
+	if [ -f ${DEVN}.stop ]
+	then
+	    echo fax daemon for ${DEV} already stopped.
+	    break
+	fi
+
 	if [ ! -w . ] ; then echo "can't write `pwd`" ; break ; fi
 	touch ${DEVN}.stop
 	echo stopping fax daemon for ${DEV}, pid=$efaxpid
@@ -707,7 +718,12 @@
 
 	st*)
 
-	if [ -f ${DEVN}.stop ] ; then stat="(set to stop)" ; fi
+# if fax device is halted, just print message, no other infos are available
+	if [ -f ${DEVN}.stop ]
+	then
+	    echo "(set to stop)"
+	    break
+	fi
 
       	if ps -u $efaxpid 2>/dev/null ; then :
       	else