summaryrefslogtreecommitdiffstats
path: root/bin/cac-ssh
blob: e01f76b10fb2e3231f30720bd96215edf8857896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/sh
set -euf

server=$(json-assert-type object "$1")
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" \
  "$@"