#ScriptSaturday with enough alias magic, bash can have real try-catch syntax!
libsh module here; BSD-3 :)