#!/usr/bin/env bash if ping -c 1 "$1"; then autossh -M 0 "$1" else echo "Host not reachable" fi