18 lines
294 B
Bash
Executable File
18 lines
294 B
Bash
Executable File
#! /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" \
|
|
"$@"
|