summaryrefslogtreecommitdiff
path: root/wlanWDprowl.sh
blob: 39553467ee0e1d13e8146f356a1da418be2414e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# wlanWDprowl.sh
# SJP 19 Nov 2017
#
# Designed to stop a headless wireless raspi from disappearing from the LAN.
# IS called from a systemd timer
#
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
fi
# end of privacy config

# Detect the state of the wireless network adaptor
wirelessLink='wlan0'    # ymmv
networkctl status ${wirlesessLink} | grep 'State:'