summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-04-12 19:15:01 +0700
committergnhb <gnoahb@gmail.com>2010-04-12 19:15:01 +0700
commitf64f0f2048212578b1bd51602ba253fb51dd5ca6 (patch)
treef7368d2ea86bc95fa28022e00dc7a4329008e9ba /usr/local/sbin
parente51cea69a05c68356ec480350a0740c045b97e5b (diff)
parentcfcaabfb608758071b065754b6bf53cb131af22a (diff)
downloadpfsense-f64f0f2048212578b1bd51602ba253fb51dd5ca6.zip
pfsense-f64f0f2048212578b1bd51602ba253fb51dd5ca6.tar.gz
Merge branch 'master' of http://gitweb.pfsense.org/pfsense/mainline into mlppp
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/ppp-linkdown11
-rw-r--r--usr/local/sbin/ppp-log-uptime.sh5
-rw-r--r--usr/local/sbin/ppp-uptime.sh3
3 files changed, 14 insertions, 5 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index 83d1790..420216f 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -1,7 +1,8 @@
#!/bin/sh
-
+if [ -f /tmp/$1up ] && [ -f /conf/$1.log ]; then
+ seconds=$((`date -j +%s` - `/usr/bin/stat -f %m /tmp/$1up`))
+ /usr/local/sbin/ppp-log-uptime.sh $seconds $1 &
+fi
# delete the node just in case mpd cannot do that
-/usr/sbin/ngctl shutdown $1:
-/bin/rm -f /var/etc/nameserver_$1
-/bin/rm -f /tmp/$1_router
-/bin/rm -f /tmp/$1up
+#/usr/sbin/ngctl shutdown $1:
+/bin/rm -f /var/etc/nameserver_$1 \ No newline at end of file
diff --git a/usr/local/sbin/ppp-log-uptime.sh b/usr/local/sbin/ppp-log-uptime.sh
new file mode 100644
index 0000000..6fd8def
--- /dev/null
+++ b/usr/local/sbin/ppp-log-uptime.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+#write the uptime in seconds to the persistent log in /conf/
+/etc/rc.conf_mount_rw
+/bin/echo `date -j +%Y.%m.%d-%H:%M:%S` $1 >> /conf/$2.log
+/etc/rc.conf_mount_ro
diff --git a/usr/local/sbin/ppp-uptime.sh b/usr/local/sbin/ppp-uptime.sh
new file mode 100644
index 0000000..d7a8441
--- /dev/null
+++ b/usr/local/sbin/ppp-uptime.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+#get ppp uptime from age of /tmp/{interface}up file
+[ -f /tmp/$1up ] && /bin/echo $((`date -j +%s` - `/usr/bin/stat -f %m /tmp/$1up`)) \ No newline at end of file
OpenPOWER on IntegriCloud