summaryrefslogtreecommitdiffstats
path: root/src/connections/ppp
diff options
context:
space:
mode:
Diffstat (limited to 'src/connections/ppp')
-rw-r--r--src/connections/ppp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/connections/ppp b/src/connections/ppp
new file mode 100644
index 0000000..ecefd63
--- /dev/null
+++ b/src/connections/ppp
@@ -0,0 +1,18 @@
+#! /bin/bash
+ppp_up() {
+ [[ -z "$PEER" ]] && PEER="provider"
+ [[ -z "$PPP_TIMEOUT" ]] && PPP_TIMEOUT=30
+
+ /usr/sbin/pppd call $PEER updetach child-timeout $PPP_TIMEOUT linkname $PEER
+
+ if [[ $? -ne 0 ]]; then
+ err_append "pppd connection failed"
+ exit 1
+ fi
+}
+
+ppp_down() {
+ kill $(head -1 /var/run/ppp-$(basename $PEER).pid)
+}
+
+# vim: set ts=4 et sw=4: