pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/speedtouch Improve "rc.d" startup script:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0c35454b014b
branches:  trunk
changeset: 488526:0c35454b014b
user:      tron <tron%pkgsrc.org@localhost>
date:      Wed Feb 02 22:09:50 2005 +0000

description:
Improve "rc.d" startup script:
- Fix shell quoting bugs in adsl_stop() procedure.
- Fix "awk" command used to find process id of "ppp" program.
- Remove SysV semaphore which might be left behind by "modem_run".
Bump package revision because of these fixes.

diffstat:

 net/speedtouch/Makefile      |   5 ++---
 net/speedtouch/files/adsl.sh |  19 +++++++++++--------
 2 files changed, 13 insertions(+), 11 deletions(-)

diffs (57 lines):

diff -r d310412256be -r 0c35454b014b net/speedtouch/Makefile
--- a/net/speedtouch/Makefile   Wed Feb 02 21:33:45 2005 +0000
+++ b/net/speedtouch/Makefile   Wed Feb 02 22:09:50 2005 +0000
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.14 2004/12/28 02:47:48 reed Exp $
-#
+# $NetBSD: Makefile,v 1.15 2005/02/02 22:09:50 tron Exp $
 
 DISTNAME=              speedtouch-1.3.1
-PKGREVISION=           1
+PKGREVISION=           2
 CATEGORIES=            net
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=speedtouch/}
 DISTFILES=             ${DISTNAME}.tar.bz2
diff -r d310412256be -r 0c35454b014b net/speedtouch/files/adsl.sh
--- a/net/speedtouch/files/adsl.sh      Wed Feb 02 21:33:45 2005 +0000
+++ b/net/speedtouch/files/adsl.sh      Wed Feb 02 22:09:50 2005 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: adsl.sh,v 1.6 2004/12/23 18:11:18 skrll Exp $
+# $NetBSD: adsl.sh,v 1.7 2005/02/02 22:09:50 tron Exp $
 #
 # PROVIDE: adsl
 # REQUIRE: NETWORKING
@@ -38,7 +38,9 @@
 
        # Ensure we have at least tun0 - NetBSD 1.6 and later
        ifconfig tun0 >/dev/null 2>&1 || ifconfig tun0 create
-       if ! @PREFIX@/sbin/modem_run -f @PREFIX@/libdata/speedtouch/$firmware; then
+       ipcrm -S -559038737  >/dev/null 2>&1
+       if ! @PREFIX@/sbin/modem_run -f @PREFIX@/libdata/speedtouch/$firmware
+       then
                echo "Couldn't download firmware to modem."
                exit 1
        fi
@@ -48,13 +50,14 @@
 
 adsl_stop()
 {
-       PPID="`ps ax | awk '/ppp -ddial adsl$/{print $1}'`
-       MPID="`ps ax | awk '/modem_run -f /{print $1}'`
-       if [ -n "$PPID $MPID" ]; then
+       PPID="`ps -ax | awk '/ppp -ddial adsl *$/{print $1}'`"
+       MPID="`ps -ax | awk '/modem_run -f /{print $1}'`"
+       if [ -n "$PPID $MPID" ]
+       then
                echo "Stopping speedtouch adsl."
-               for pid in $PPID $MPID; do
-                       kill $pid
-               done
+               kill $PPID $MPID >/dev/null 2>&1
+               sleep 1
+               ipcrm -S -559038737 >/dev/null 2>&1
        fi
 }
 



Home | Main Index | Thread Index | Old Index