diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cac.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/cac.sh b/lib/cac.sh index c78576ebf..fea6886be 100644 --- a/lib/cac.sh +++ b/lib/cac.sh @@ -1,5 +1,21 @@ . ./lib/url.sh +cac_ssh() {( + server=$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" \ + "$@" +)} cac_getserver_by_servername() {( serverlist=$(cac_listservers) |