Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=2deb2c6188db1c36d6740e19db1fc59b842a719c

commit 2deb2c6188db1c36d6740e19db1fc59b842a719c
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Fri Oct 8 15:58:01 2010 +0200

wvdial-1.61-2-i686

- add wrappers to start/stop wvdial in an async way

diff --git a/source/network/wvdial/FrugalBuild 
b/source/network/wvdial/FrugalBuild
index 1a70395..e2a54af 100644
--- a/source/network/wvdial/FrugalBuild
+++ b/source/network/wvdial/FrugalBuild
@@ -4,21 +4,25 @@

pkgname=wvdial
pkgver=1.61
-pkgrel=1
+pkgrel=2
pkgdesc="WVDial CLI dialer"
groups=('network')
depends=('wvstreams>=4.6.1' 'zlib')
archs=('i686' 'x86_64')
up2date="lynx -dump -nolist 'http://alumnit.ca/wiki/?DownloadReleases'|grep 
'wvdial-\(.*\).tar.gz'|sed 's/.*-\(.*\).tar.*$/\1/'"
url="http://alumnit.ca/download/";
-source=(http://wvstreams.googlecode.com/files/${pkgname}-${pkgver}.tar.gz 
wvdial-1.61-destdir.patch)
+source=(http://wvstreams.googlecode.com/files/${pkgname}-${pkgver}.tar.gz 
wvdial-1.61-destdir.patch wvdial-up wvdial-down)
backup=(etc/ppp/peers/{wvdial,wvdial-pipe})
sha1sums=('2878cae3aaf067989eebc7313ccd2cec59893345' \
-          'c07bbab034ef59ddc99bc1f045ef06888b21264d')
+          'c07bbab034ef59ddc99bc1f045ef06888b21264d' \
+          '6b2654d0e9591bd6498d77163fdfa19f16069456' \
+          '29884131b5408ba5dd9c4b4e8dd6afaf3268e1fa')

build() {
unset MAKEFLAGS
Fbuild
Fexerel debian/pon.wvdial /usr/bin/pon.wvdial
Fexerel debian/pon.wvdial /usr/bin/poff.wvdial
+       Fexe /usr/bin/wvdial-up
+       Fexe /usr/bin/wvdial-down
}
diff --git a/source/network/wvdial/wvdial-down 
b/source/network/wvdial/wvdial-down
new file mode 100644
index 0000000..c17b63b
--- /dev/null
+++ b/source/network/wvdial/wvdial-down
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+pid=$(cat /var/run/wvdial.pid 2>/dev/null)
+
+if [ -d /proc/$pid ]; then
+       kill -INT $pid
+       echo "INFO: wvdial stopped successfully"
+else
+       echo "ERROR: wvdial is not running"
+fi
diff --git a/source/network/wvdial/wvdial-up b/source/network/wvdial/wvdial-up
new file mode 100644
index 0000000..0fe03f4
--- /dev/null
+++ b/source/network/wvdial/wvdial-up
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+wvdial $1 &>/var/log/wvdial.log &
+pid=$!
+echo $pid > /var/run/wvdial.pid
+
+ret=0
+i=0
+while true
+do
+       if [ ! -e /var/log/wvdial.log ]; then
+               touch /var/log/wvdial.log
+       fi
+       if grep -q DNS /var/log/wvdial.log || [ $i -gt 60 ]; then
+               [ $i -gt 60 ] && ret=1
+               break
+       fi
+       sleep 1
+       i=$(($i+1))
+done
+
+if [ $ret == 0 ]; then
+       echo "INFO: wvdial started successfully"
+else
+       echo "ERROR: timeout, see /var/log/wvdial.log"
+fi
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to