How The Cisco Umbrella Roaming Client For Mac
On Tuesday October 30, 2018, Cisco Umbrella will release the Umbrella roaming client for macOS version 2.1.9 for all customers on the second and third waves of the production track. CHANGE SUMMARY (2.1.4 to 2.1.9) Switched to an internal logger instead of relying on a third party, lumberjack.
Cisco Umbrella Roaming Client management script for Mac OS X. This makes it easy to manage the background processes of umbrella to start, stop, restart, sleep and get status.
umbrella
#!/usr/bin/env bash |
# Quinn Comendant <quinn@strangecode.com> |
# https://gist.github.com/quinncomendant/3be731567e529415d5ee |
# Since 25 Jan 2015 |
# Version 1.2 |
CMD=$1; |
if [[ `id -u`= 0 ]];then |
echo'You mustn't be root when executing this script'; |
exit; |
fi |
functionusage { |
echo'CLI tool to manage the Cisco Umbrella Roaming Client on macOS. |
https://docs.umbrella.com/product/umbrella/umbrella-roaming-security/ |
This script will invoke sudo to start (launchctl) and stop (killall) services. |
Usage: $(basename $0) COMMAND |
COMMANDS: |
stop Stop the umbrella services via launchctl. |
start Start the umbrella services via launchctl. |
restart Stop umbrella, then start again. |
status Show some info about umbrella's status. |
quickstatus Return exit code 0 if umbrella is running, otherwise exit code 1. |
sleep [N] Stop umbrella for N seconds (default 60), then start it again (time enough to open a banned URL). |
'; |
exit 1; |
} |
functionstart () { |
echo'Starting umbrella…'; |
sudo launchctl load /Library/LaunchDaemons/com.opendns.osx.RoamingClientConfigUpdater.plist; |
sudo launchctl bootstrap system/com.apple.Dock.plist /Library/LaunchAgents/com.opendns.osx.RoamingClientMenubar.plist |
launchctl load /Library/LaunchAgents/com.opendns.osx.RoamingClientMenubar.plist |
} |
functionstop () { |
echo'Stopping umbrella…'; |
sudo launchctl remove com.opendns.osx.RoamingClientConfigUpdater; |
launchctl remove com.opendns.osx.RoamingClientMenubar; |
sudo killall OpenDNSDiagnostic &>/dev/null; |
sleep 1; |
$0 quickstatus echo'Umbrella is stopped'; |
} |
functionstatus () { |
if$0 quickstatus;then |
echo'Umbrella is running. Checking debug.opendns.com DNS…'; |
dig debug.opendns.com txt +time=2 +tries=1 +short sed 's/^'/ '/' grep '''; |
[[ 1 $? ]] &&echo'Umbrella is not functioning correctly!' |
else |
# Some part of umbrella is stopped. Let's stop it all to remain consistent. |
stop &>/dev/null |
echo'Umbrella is stopped'; |
grep -q 127.0.0.1 /etc/resolv.conf &&echo'Without umbrella running, you'll need to remove 127.0.0.1 from your DNS servers before you can resolve domains.'; |
fi |
echo'Currently using name servers: $(cat /etc/resolv.conf grep nameserver sed 's/nameserver //' tr 'n''') (akamai says $(dig whoami.akamai.net +short); ultradns says $(dig whoami.ultradns.net +short))'; |
} |
functionquickstatus () { |
# Exit status 0 = dnscrypt is running. |
if [[ 3 -eq$(ps auwwx egrep '/(dnscrypt RoamingClientMenubar dns-updater)' grep -v egrep wc -l) ]];then |
exit 0; |
else |
exit 1; |
fi; |
} |
case$CMDin |
(start) start;; |
(stop) stop;; |
(restart) stop && start;; |
(sleep) duration=${2:-60}; stop &&echo'Sleeping $duration seconds…'&& sleep $duration&& start;; |
(status) status;; |
(quickstatus) quickstatus;; |
(*) usage;; |
esac |
exit 0; |
commented Mar 30, 2016
this is great. works well |
commented Oct 23, 2016
commented Oct 25, 2016
Thanks!! Just saved me a lot of time. |
commented Feb 8, 2017
Updated the umbrella script to version 1.2:
|
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment