Last active
February 1, 2024 19:51
-
-
Save ericboehs/1569377fb54a4d31cb7aed70be31cc02 to your computer and use it in GitHub Desktop.
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
#! /usr/bin/env bash | |
# <bitbar.title>VA SOCKS</bitbar.title> | |
# <bitbar.version>v1.0</bitbar.version> | |
# <bitbar.author>Eric Boehs</bitbar.author> | |
# <bitbar.author.github>ericboehs</bitbar.author.github> | |
# <bitbar.desc>Connects to VA SOCKS and provides useful links</bitbar.desc> | |
# <swiftbar.hideAbout>true</swiftbar.hideAbout> | |
# <swiftbar.hideRunInTerminal>true</swiftbar.hideRunInTerminal> | |
# <swiftbar.hideLastUpdated>true</swiftbar.hideLastUpdated> | |
# <swiftbar.hideDisablePlugin>true</swiftbar.hideDisablePlugin> | |
# <swiftbar.hideSwiftBar>true</swiftbar.hideSwiftBar> | |
PID_LISTENING=$(lsof -Pi :2001 -sTCP:LISTEN -t) | |
PROCESS_LISTENING=$(ps -p $PID_LISTENING -o comm=) | |
SOCKS_CONNECTED=$(ps $PID_LISTENING | grep -q ssh && echo true || echo false) | |
if $SOCKS_CONNECTED; then | |
echo ":lock.icloud: | size=16 shortcut=OPT+S" | |
else | |
echo ":icloud.slash: | size=16 shortcut=OPT+S" | |
fi | |
echo "---" | |
echo "VA SOCKS" | |
echo "---" | |
if $SOCKS_CONNECTED; then | |
echo "Reconnect | bash='/Users/ericboehs/.asdf/shims/vtk' param1='socks' param2='on' terminal=false" | |
echo "Disconnect | bash='/Users/ericboehs/.asdf/shims/vtk' param1='socks' param2='off' terminal=false" | |
echo "Kill $PROCESS_LISTENING | bash='kill' param1=\"$PID_LISTENING\" terminal=false alternate=true" | |
else | |
echo "Connect | bash='/Users/ericboehs/.asdf/shims/vtk' param1='socks' param2='on' terminal=false" | |
if [ -n "$PROCESS_LISTENING" ]; then | |
echo "Kill $PROCESS_LISTENING | bash='kill' param1=\"$PID_LISTENING\" terminal=false" | |
fi | |
fi | |
echo "---" | |
echo "ArgoCD | href='https://argocd.vfs.va.gov'" | |
echo "-- vets-api-dev | href='https://argocd.vfs.va.gov/applications/vets-api-dev'" | |
echo "-- vets-api-staging | href='https://argocd.vfs.va.gov/applications/vets-api-staging'" | |
echo "-- vets-api-sandbox | href='https://argocd.vfs.va.gov/applications/vets-api-sandbox'" | |
echo "-- vets-api-prod | href='https://argocd.vfs.va.gov/applications/vets-api-prod'" | |
echo "Jenkins | href='http://jenkins.vfs.va.gov'" | |
echo "Sentry | href='http://sentry.vfs.va.gov'" | |
echo "Grafana/Loki | href='http://grafana.vfs.va.gov'" | |
echo "Prometheus | href='http://prometheus-prod.vfs.va.gov:9090'" | |
echo "---" | |
echo "AWS Console | href='http://dsvagovcloud.signin.amazonaws-us-gov.com/console'" | |
echo "Datadog | href='http://vagov.ddog-gov.com'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Screenshot.2024-01-05.at.10.20.01.mp4