summaryrefslogtreecommitdiffstats
path: root/src/ppp.subr
diff options
context:
space:
mode:
authorJames Rayner <james@archlinux.org>2007-11-10 00:43:57 +0100
committerJames Rayner <james@archlinux.org>2007-11-10 00:43:57 +0100
commite9f9e4d54cb3afb6d78a12e85035a24d346c381d (patch)
treeb3971b8737ab56b6055d2440f5b78c74fc2adb25 /src/ppp.subr
downloadnetctl-e9f9e4d54cb3afb6d78a12e85035a24d346c381d.tar.gz
netctl-e9f9e4d54cb3afb6d78a12e85035a24d346c381d.tar.xz
Initial Import
Diffstat (limited to 'src/ppp.subr')
-rw-r--r--src/ppp.subr21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ppp.subr b/src/ppp.subr
new file mode 100644
index 0000000..c05ebd7
--- /dev/null
+++ b/src/ppp.subr
@@ -0,0 +1,21 @@
+#! /bin/bash
+ppp_up() {
+ [ -z "$PEER" ] && PEER="/etc/ppp/peers/provider"
+ [ -z "$PPP_TIMEOUT" ] && PPP_TIMEOUT=30
+
+ /usr/sbin/pppd call $PEER updetach child-timeout $PPP_TIMEOUT linkname $(basename $PEER)
+
+ if [ $? -ne 0 ]; then
+ err "pppd connection failed"
+ exit 1
+ fi
+}
+
+ppp_down() {
+ kill $(cat /var/run/ppp-$(basename $PEER))
+}
+
+ppp_clean_scope() {
+ unset PPP_PEER PPP_TIMEOUT
+}
+# vim: set ts=4 et sw=4: