stockholm/bin/cac-ssh

18 lines
294 B
Plaintext
Raw Normal View History

2015-05-20 23:56:08 +00:00
#! /bin/sh
set -euf
2015-05-21 00:19:23 +00:00
server=$(json-assert-type object "$1")
2015-05-20 23:56:08 +00:00
shift
address=$(echo $server | jq -r .ip)
target=root@$address
SSHPASS=$(echo $server | jq -r .rootpass)
export SSHPASS
exec sshpass -e ssh \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null \
"$target" \
"$@"