Last active
October 23, 2018 20:08
-
-
Save rabin-io/508fefb7a08a10d307af77d13839b34e to your computer and use it in GitHub Desktop.
88-MASTER-DISPATCHER
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ -z ${CONNECTION_UUID} ]] && exit 0 | |
DEVICE=${1} | |
STATE=${2} | |
CWD=$(dirname "$0") | |
LOG='/var/log/NetworkManager_dispatcher.d.log' | |
# DEBUG | |
echo "$(date +"%F %T") Called with ($*) and connection uuid is: ${CONNECTION_UUID}" >> ${LOG} | |
# Needed only if you need to display notification popups | |
#export DISPLAY=:0.0 | |
#export $(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep session)/environ) | |
for FILE in ${CWD}/${CONNECTION_UUID}/${STATE}/* | |
do | |
#DEBUG | |
echo "$(date +"%F %T") Running ${FILE}" >> ${LOG} | |
. "${FILE}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment