feat manage script

This commit is contained in:
2025-02-24 09:51:41 +00:00
commit 1a3a374f3b
45 changed files with 2149 additions and 0 deletions

29
config/shared/bin/ssh-forward Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 <user@host> <port1> [port2] [port3] ..."
exit 1
}
# Ensure at least two arguments are provided: host and one port
if [ "$#" -lt 2 ]; then
usage
fi
# Extract the host from the first argument
HOST="$1"
shift # Shift the arguments so that $@ contains the remaining ports
# Initialize the PORTS variable
PORTS=""
# Iterate over the remaining arguments, which are the ports
for port in "$@"; do
PORTS="$PORTS -L ${port}:localhost:${port}"
done
# Construct and run the SSH command
SSH_CMD="ssh -N -T -o ExitOnForwardFailure=yes $HOST $PORTS"
echo "Running: $SSH_CMD"
$SSH_CMD