Last active
November 3, 2020 03:45
-
-
Save gregswift/bb901138a85984000262914d91d6f3ee to your computer and use it in GitHub Desktop.
appgate_ps1.sh
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
source appgate_ps1.sh | |
# Obviously manage your PS1 however you are gonna mange it... this is just an example | |
PS1="\u@\h \W \$(__appgate_ps1) $" |
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
# Pull this from https://gist.github.com/gregswift/11ee552bc443e1051eef9454c833c07f | |
source colorize.bashrc | |
function __appgate_ps1() { | |
# Despite not upgrading this went away | |
#appgate_running=$(ps aux | awk '/enable-dbus=com.appgate.resolver/ && !/awk/ { print "1" }') | |
#if [ "${appgate_running}" == "1" ]; then | |
# But this works, at least on linux.. need to figure out crossplatform. | |
appgate_running=$(ip address show dev tun0 2>/dev/null >/dev/null; echo $?) | |
if [ "${appgate_running}" == "0" ]; then | |
COLOR=green | |
STATUS=⊙ | |
else | |
COLOR=red | |
STATUS=⊗ | |
fi | |
echo $(colorize ${STATUS} ${COLOR}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment