summaryrefslogtreecommitdiff
path: root/src/etc/ppp
diff options
context:
space:
mode:
Diffstat (limited to 'src/etc/ppp')
-rwxr-xr-xsrc/etc/ppp/ip-down.d/0020-wirelessmodem18
-rwxr-xr-xsrc/etc/ppp/ip-up.d/0020-wirelessmodem18
-rw-r--r--src/etc/ppp/peers/chat/att6
-rw-r--r--src/etc/ppp/peers/chat/sc113
-rw-r--r--src/etc/ppp/peers/chat/verizon5
5 files changed, 36 insertions, 24 deletions
diff --git a/src/etc/ppp/ip-down.d/0020-wirelessmodem b/src/etc/ppp/ip-down.d/0020-wirelessmodem
new file mode 100755
index 000000000..c93c7cabe
--- /dev/null
+++ b/src/etc/ppp/ip-down.d/0020-wirelessmodem
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+tty=$2
+ipparam=$6
+
+# Only applicable for Wireless Modems (WWAN)
+if [ -z "$(echo $tty | egrep "tty(USB|ACM)")" ]; then
+ exit 0
+fi
+
+# device name and metric are received using ipparam
+device=`echo "$ipparam"|awk '{ print $1 }'`
+metric=`echo "$ipparam"|awk '{ print $2 }'`
+
+vtysh -c "conf t" -c "no ip route 0.0.0.0/0 ${device} ${metric}"
+
+DIALER_PID=$(cat /var/run/${device}.pid)
+logger -t pppd[$DIALER_PID] "removed default route via $device metric $metric"
diff --git a/src/etc/ppp/ip-up.d/0020-wirelessmodem b/src/etc/ppp/ip-up.d/0020-wirelessmodem
new file mode 100755
index 000000000..95549387b
--- /dev/null
+++ b/src/etc/ppp/ip-up.d/0020-wirelessmodem
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+tty=$2
+ipparam=$6
+
+# Only applicable for Wireless Modems (WWAN)
+if [ -z "$(echo $tty | egrep "tty(USB|ACM)")" ]; then
+ exit 0
+fi
+
+# device name and metric are received using ipparam
+device=`echo "$ipparam"|awk '{ print $1 }'`
+metric=`echo "$ipparam"|awk '{ print $2 }'`
+
+vtysh -c "conf t" -c "ip route 0.0.0.0/0 ${device} ${metric}"
+
+DIALER_PID=$(cat /var/run/${device}.pid)
+logger -t pppd[$DIALER_PID] "added default route via $device metric $metric"
diff --git a/src/etc/ppp/peers/chat/att b/src/etc/ppp/peers/chat/att
deleted file mode 100644
index 7a02682f5..000000000
--- a/src/etc/ppp/peers/chat/att
+++ /dev/null
@@ -1,6 +0,0 @@
-ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT 'NO CARRIER' ABORT DELAYED
-'' AT
-OK ATZ
-OK 'AT+CGDCONT=1,"IP","ISP.CINGULAR"'
-OK ATD*99#
-CONNECT ''
diff --git a/src/etc/ppp/peers/chat/sc1 b/src/etc/ppp/peers/chat/sc1
deleted file mode 100644
index fbfabd8c2..000000000
--- a/src/etc/ppp/peers/chat/sc1
+++ /dev/null
@@ -1,13 +0,0 @@
-TIMEOUT 60
-ABORT ERROR
-ABORT BUSY
-ABORT VOICE
-ABORT "NO CARRIER"
-ABORT "NO DIALTONE"
-ABORT "NO DIAL TONE"
-ABORT "NO ANSWER"
-"" "ATZ"
-"" "AT&FH0M0"
-OK-AT-OK "ATDT*99#"
-TIMEOUT 75
-CONNECT
diff --git a/src/etc/ppp/peers/chat/verizon b/src/etc/ppp/peers/chat/verizon
deleted file mode 100644
index a36a3e915..000000000
--- a/src/etc/ppp/peers/chat/verizon
+++ /dev/null
@@ -1,5 +0,0 @@
-ABORT 'NO CARRIER' ABORT 'ERROR' ABORT 'NO DIALTONE' ABORT
-'BUSY' ABORT 'NO ANSWER'
-'' ATZ
-OK-AT-OK ATDT#777
-CONNECT \d\c