You can use 'host.example.net:2222' as parameter now

This commit is contained in:
Martin Berghaus
2025-03-26 01:16:14 +01:00
parent 9597e32b62
commit 59e7f9abdd
2 changed files with 8 additions and 2 deletions

View File

@@ -1,7 +1,10 @@
#!/bin/bash
_REMOTE_HOST="${1:?"FQDN of server missing"}"
_REMOTE_PORT="${2:-"22"}"
_REMOTE_PORT="${_REMOTE_HOST}:"
_REMOTE_PORT="${_REMOTE_PORT#*:}"
_REMOTE_PORT="${_REMOTE_PORT%%:*}"
_REMOTE_PORT="${_REMOTE_PORT:-"22"}"
_REMOTE_USER="monitoring"
_SOCKET='~/.ssh/%r@%h:%p'

View File

@@ -1,7 +1,10 @@
#!/bin/bash
_REMOTE_HOST="${1:?"FQDN of server missing"}"
_REMOTE_PORT="${2:-"22"}"
_REMOTE_PORT="${_REMOTE_HOST}:"
_REMOTE_PORT="${_REMOTE_PORT#*:}"
_REMOTE_PORT="${_REMOTE_PORT%%:*}"
_REMOTE_PORT="${_REMOTE_PORT:-"22"}"
_REMOTE_USER="monitoring"
_SOCKET='~/.ssh/%r@%h:%p'