diff options
author | tron <tron> | 2005-02-02 22:09:50 +0000 |
---|---|---|
committer | tron <tron> | 2005-02-02 22:09:50 +0000 |
commit | c16375532cae03c0430eea4d30d782432239e082 (patch) | |
tree | 9d34a35e3aaf812129d9cdc0449b3559e78fb0e5 /net | |
parent | 6bd7a3307461135ec1e78bf6a80fa9fa207c8c9c (diff) | |
download | pkgsrc-c16375532cae03c0430eea4d30d782432239e082.tar.gz |
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 (limited to 'net')
-rw-r--r-- | net/speedtouch/Makefile | 5 | ||||
-rw-r--r-- | net/speedtouch/files/adsl.sh | 19 |
2 files changed, 13 insertions, 11 deletions
diff --git a/net/speedtouch/Makefile b/net/speedtouch/Makefile index 060d5a41835..497ff1f927d 100644 --- a/net/speedtouch/Makefile +++ b/net/speedtouch/Makefile @@ -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 --git a/net/speedtouch/files/adsl.sh b/net/speedtouch/files/adsl.sh index 036c2dd331a..e8e974f304b 100644 --- a/net/speedtouch/files/adsl.sh +++ b/net/speedtouch/files/adsl.sh @@ -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 @@ adsl_start() # 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_start() 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 } |