Created
December 10, 2025 11:34
-
-
Save mrl22/e52f2a541c4e1e4a53880d93f2232c62 to your computer and use it in GitHub Desktop.
RoyalTSX SSH Wrapper for Mac Terminal - PasswordAuthentication only.
This file contains hidden or 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 | |
| # sshh - Royal TSX launcher wrapper | |
| set -euo pipefail | |
| port="" | |
| target="" | |
| # Parse args | |
| while [ "$#" -gt 0 ]; do | |
| case "$1" in | |
| -p) | |
| shift | |
| port="$1" | |
| ;; | |
| -*) | |
| # ignore other flags | |
| ;; | |
| *) | |
| target="$1" | |
| ;; | |
| esac | |
| shift | |
| done | |
| if [ -z "${target}" ]; then | |
| echo "Usage: sshh [-p port] user@host" >&2 | |
| exit 1 | |
| fi | |
| case "${target}" in | |
| *@*) | |
| user="${target%@*}" | |
| host="${target#*@}" | |
| ;; | |
| *) | |
| echo "Target must be in the form user@host" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| # Build Royal TSX URL | |
| # Base: | |
| # rtsx://ssh%3a%2f%2fuser%3a@host%3a[port]%3a?property_Name=host | |
| url="rtsx://ssh%3a%2f%2f${user}%3a@${host}" | |
| if [ -n "${port}" ]; then | |
| url="${url}%3a${port}" | |
| fi | |
| url="${url}%3a?property_Name=${host}" | |
| # Launch Royal TSX | |
| open -n -F -W "${url}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment