#!/bin/bash if ping -q -c 1 host >/dev/null 2>&1 then ssh -n x10@host "~x10/bin/action" "$@" elif ping -q -c 1 host.domain.baka >/dev/null 2>&1 then ssh -n x10@host.domain.baka "~x10/bin/action" "$@" else echo "action: Not online: Requested" $@ fi exit 0