#!/bin/bash # Configuration SSH_USER="connor.johnstone@arcfield.com" SSH_HOST="localhost" SSH_PORT="9000" REMOTE="${SSH_USER}@${SSH_HOST}:${SSH_PORT}" # Check if we can access work's gitlab (which means sshuttle is working) if ping -c 1 gitserver.idm.orionspace.com &> /dev/null; then # Running echo '{"text": "", "tooltip": "Connected", "class": "connected"}' elif ping -c 1 10.0.0.24 &> /dev/null; then # Otherwise, check if we can even access the work laptop at all echo '{"text": "", "tooltip": "Disconnected", "class": "disconnected"}' else # No connection at all echo '{"text": "", "tooltip": "No ssh tunnel", "class": "disconnected"}' fi