summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--wlanWDlog.conf1
-rw-r--r--wlanWDog.timer1
-rwxr-xr-xwlanWDprowl.sh13
4 files changed, 11 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index b76c99e..8ec602a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,2 @@
-logdir.config
+wlanWDlogdir.conf
log/*
diff --git a/wlanWDlog.conf b/wlanWDlog.conf
new file mode 100644
index 0000000..c0ed0b7
--- /dev/null
+++ b/wlanWDlog.conf
@@ -0,0 +1 @@
+logdir=/home/st33v/dev/wlanWatchdog/log
diff --git a/wlanWDog.timer b/wlanWDog.timer
index a9c9829..c75347f 100644
--- a/wlanWDog.timer
+++ b/wlanWDog.timer
@@ -3,6 +3,7 @@ Description=Walk the wireless watchdog
[Timer]
OnActiveSec=5min
+OnUnitActiveSec=1min
#OnCalendar=*:*:00,30
Unit=wlanWDog.service
diff --git a/wlanWDprowl.sh b/wlanWDprowl.sh
index 3955346..70db23c 100755
--- a/wlanWDprowl.sh
+++ b/wlanWDprowl.sh
@@ -8,14 +8,17 @@
cd /usr/local/bin
# The following block enables private configuration
logdir="/path/to/my/log" # overwritten by sourcing from .logdir.config
-if [ -e logdir.config ]; then
- . logdir.config # source directory name from local config file
-else echo "logdir.config does not exist"; exit 1
+if [ -e wlanWDlog.conf ]; then
+ . wlanWDlog.conf # source directory name from local config file
+else echo "wlanWDlog.conf does not exist"; exit 1
fi
# end of privacy config
# Detect the state of the wireless network adaptor
wirelessLink='wlan0' # ymmv
-networkctl status ${wirlesessLink} | grep 'State:'
-
+wlanStatus=$(networkctl status ${wirelessLink} | grep 'State:')
+echo ${wlanStatus}
+echo $(whoami)
+logline=$(date)${wlanStatus}
+echo ${logline} >> ${logdir}/wlanStatus.log