diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/netmonitor_down | 11 | ||||
-rwxr-xr-x | scripts/netmonitor_up | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/scripts/netmonitor_down b/scripts/netmonitor_down new file mode 100755 index 0000000..6ce6064 --- /dev/null +++ b/scripts/netmonitor_down @@ -0,0 +1,11 @@ +#!/bin/sh +# +# simple log the time when connection was started +# + +if [ -r /etc/sysconfig/network-scripts/ifcfg-$1 ]; then + . /etc/sysconfig/network-scripts/ifcfg-$1 + if [ "a$ACCOUNTING" = "ayes" ]; then + echo $1:DOWN:$(date +%s) >> /var/log/net_monitor + fi +fi diff --git a/scripts/netmonitor_up b/scripts/netmonitor_up new file mode 100755 index 0000000..a0cba3f --- /dev/null +++ b/scripts/netmonitor_up @@ -0,0 +1,11 @@ +#!/bin/sh +# +# simple log the time when connection was started +# + +if [ -r /etc/sysconfig/network-scripts/ifcfg-$1 ]; then + . /etc/sysconfig/network-scripts/ifcfg-$1 + if [ "a$ACCOUNTING" = "ayes" ]; then + echo $1:UP:$(date +%s) >> /var/log/net_monitor + fi +fi |