AnyConnect Umbrella Status

Check and toggle status of Umbrella Roaming Security Module for Cisco AnyConnect.

Image preview of AnyConnect Umbrella Status plugin.

umbrella_status.15m.sh

Edit
Open on GitHub
#!/bin/bash
# <xbar.title>AnyConnect Umbrella Status</xbar.title>
# <xbar.version>v1.3</xbar.version>
# <xbar.author>Jason Masker</xbar.author>
# <xbar.author.github>jasmas</xbar.author.github>
# <xbar.desc>Check and toggle status of Umbrella Roaming Security Module for Cisco AnyConnect.</xbar.desc>
# <xbar.image>https://i.imgur.com/Jznovev.png</xbar.image>

PLUGIN_BASE='/opt/cisco/anyconnect/bin/plugins'

IMG_DISABLED='iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAEDWlDQ1BJQ0MgUHJvZmlsZQAAOI2NVV1oHFUUPrtzZyMkzlNsNIV0qD8NJQ2TVjShtLp/3d02bpZJNtoi6GT27s6Yyc44M7v9oU9FUHwx6psUxL+3gCAo9Q/bPrQvlQol2tQgKD60+INQ6Ium65k7M5lpurHeZe58853vnnvuuWfvBei5qliWkRQBFpquLRcy4nOHj4g9K5CEh6AXBqFXUR0rXalMAjZPC3e1W99Dwntf2dXd/p+tt0YdFSBxH2Kz5qgLiI8B8KdVy3YBevqRHz/qWh72Yui3MUDEL3q44WPXw3M+fo1pZuQs4tOIBVVTaoiXEI/MxfhGDPsxsNZfoE1q66ro5aJim3XdoLFw72H+n23BaIXzbcOnz5mfPoTvYVz7KzUl5+FRxEuqkp9G/Ajia219thzg25abkRE/BpDc3pqvphHvRFys2weqvp+krbWKIX7nhDbzLOItiM8358pTwdirqpPFnMF2xLc1WvLyOwTAibpbmvHHcvttU57y5+XqNZrLe3lE/Pq8eUj2fXKfOe3pfOjzhJYtB/yll5SDFcSDiH+hRkH25+L+sdxKEAMZahrlSX8ukqMOWy/jXW2m6M9LDBc31B9LFuv6gVKg/0Szi3KAr1kGq1GMjU/aLbnq6/lRxc4XfJ98hTargX++DbMJBSiYMIe9Ck1YAxFkKEAG3xbY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/vr6AP77+wD/+/sAAAEBAPLNzQDZdnYA9djYAAomJgAGFhYA7r+/ANyAgAD44+MAAP//AP/6+gD++/sA/vr6AP76+gD//PwAAQD/AAgGAgCtx+gAg6baAMCHOAA8KBAARC4UAPj4/ABMe8cABQL/AAD9/gAA/v4AAP7+AAD+/gAAAAEAAgAAAAD//PwA/vr6AP/7+wD/+voA//r6AP/6+gD/+/sABA4OAAYSEgAAAAAAAAAAAAYWFgADCwsA//r6AP/6+gD/+voA//r6AP/6+gD/+voA//39APz+AACauOIAuczqALyHOAAMCgQAuM/sAC4hDQA4bMIA4+TyAP/8/gD//P0A//z9AP/8/QAA/P4AAAEAAAIAAAAA//z8AP/8/AD++/sA/vz8AP78/AD99fUAE0NDACiPjwAFFhYA7by8APPT0wAMKysAJ4uLAAwrKwD99fUA/vz8AP78/AD++/sA//z8AAD9/QABAAAAhpDPAHRYJgDx8vsA5+35ABAHAgA0aL8A1tzvAAIAAQAA/QAAAP0AAAD9AAAA/QAA//3/AAAAAAACAAAAAP/8/AD++/sA//z8AP/8/AD/+fkAFElJACWCggAGFRUA7Lq6ANl3dwDWcHAA89PTAAwqKgAniYkADS8vAP/5+QD//PwA//z8AP77+wD++voA////ALWcRABihcoA8fv9AIOi2ADDy+cA1NrvAAEA/wD+/f0A/v79AP7+/QD+/v0A/v79AP/+/gACAgH/AgAAAAH///8A/vj4AP/6+gD+9/cACycnACeGhgAGFhYA78PDANp4eAD45uYA9dTUANhzcwD01tYACyYmACeHhwAFFBQA//j4AP/7+wD//PwABA8PAAQDAgDj5/UADwoFACVRtACZq9kABAIBAAL//wAA/f8AAP3/AAD9/wAA/f8AAP3/AAD+/wD//f8AAQD/+wIAAQG7H25u+w0vLwD89vYA//7+AP77+wD56OgA7Lm5ANVsbAD24eEA////AP8BAQDwy8sA1m5uAPLQ0AD67u4A//z8AP78/AD++/sAHWZmABx+ggCvweIAXn/GAL/J5gD///8AAwIBAP/9/wD//v8A//7/AP/+/wD//v8A//7/AP/+/wD//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AAAAAAAAAA/gEGADYZ5KA6IeiiAgEBAfQA//92IBMk6XdGgwAZDhsA+fv5AP3+/AD/AP8A9/z0AN7u1QD3/vUA/wD/AP3+/QD+/v4A/v7+AP7+/QD6/PkAFQwYAHVGgwAOAx8AeZPNAPPz/AD//QAA//4AAP/+AAD//gAA//4AAP/+AAD//gAA//4AAP//AAD//wAA/v8FACQR7sA/JOe1/v7/7QEAAAAAAAAAAP/+/1wAAQCUxd2+D4a4egDS5c8ABQMEAAIBAgABAQEAAQAAAP8AAAAAAAAA////AP///gD7/fsAKhkwAHlIhAA0G0D9kaLF4Ke10ewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8AAAABAAD//wD9AQD/9i8b7cgdD/XS+fwB4v39/eQBAAAAAAAAAAD//v4G/f39WAMEBIve69oWn8eUALDSqwD3+/QAAAAAAP///gAAAAAAAAEBAAEBAQAIAwoASixPAGY8cgAfECPyzMzMqrS0tMv4+Pj8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP8BAQH/AAAA/P////YAAADx/v7+7P7+/u35+fnxAQAAAAAAAAAAAAAAAAAAAAD7+fk8AwUFh/3+/TDq8+YLudeyAdTnzwDg7t8A/wAAAB8QHwArGjAARihN/xgOG/b+/P/b0tHRkaeoqM8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wICAv3////7AAAA+Pv7+/YAAAD34eHh+QEAAAAAAAAAAAAAAAAAAAAAAAAAAOno6AwTFBRPAQEBRQEBATkBAQAi//8ABAAAAAAAAAD8////3/z8/Mr4+PjAvr2+tsbHxvYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPf39/8CAgL/AAAA/vz8/Pz6+vr92tra/cLCwv9sojkdx6Z+8QAAAABJRU5ErkJggg=='

# Check plugin status, return 0 if enabled, 1 if disabled
function check_status {
    [[ -f $PLUGIN_BASE/libacumbrellaapi.dylib ]] &&
    [[ -f $PLUGIN_BASE/libacumbrellactrl.dylib ]] &&
    [[ -f $PLUGIN_BASE/libacumbrellaplugin.dylib ]]
}

# Check if plugin disabled by utility, return 0 if yes, 1 if no
function verify_plugin_disabled {
    [[ -f $PLUGIN_BASE/disabled/libacumbrellaapi.dylib ]] &&
    [[ -f $PLUGIN_BASE/disabled/libacumbrellactrl.dylib ]] &&
    [[ -f $PLUGIN_BASE/disabled/libacumbrellaplugin.dylib ]]
}

# Disable plugin
function disable_plugin {
    /usr/bin/osascript -e "do shell script \"mkdir -p $PLUGIN_BASE/disabled && mv -f $PLUGIN_BASE/libacumbrellaapi.dylib $PLUGIN_BASE/libacumbrellactrl.dylib $PLUGIN_BASE/libacumbrellaplugin.dylib $PLUGIN_BASE/disabled/\" with administrator privileges"
}

# Enable plugin
function enable_plugin {
    /usr/bin/osascript -e "do shell script \"mv -f $PLUGIN_BASE/disabled/libacumbrellaapi.dylib $PLUGIN_BASE/disabled/libacumbrellactrl.dylib $PLUGIN_BASE/disabled/libacumbrellaplugin.dylib $PLUGIN_BASE/\" with administrator privileges"
}

case "$1" in
    'enable')
        verify_plugin_disabled &&
        enable_plugin
        ;;
    'disable')
        check_status &&
        disable_plugin
        ;;
    *)
        check_status &&
        echo "| image=$IMG_ENABLED" ||
        echo "| image=$IMG_DISABLED"

        echo '---'

        (check_status &&
        echo "Disable Cisco Umbrella| terminal=false refresh=true bash='$0' param1=disable") ||
        (verify_plugin_disabled &&
        echo "Enable Cisco Umbrella| terminal=false refresh=true bash='$0' param1=enable")

esac