File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ if [ -n "$port" ]; then
1010 ssh_options+=(-p $port )
1111fi
1212
13+ password=$( jq -r .password $filename )
14+ if [ -n " $password " ]; then
15+ TMP_PASS=$( mktemp)
16+ echo " $password " > $TMP_PASS
17+ sshpass_command=" sshpass -f $TMP_PASS "
18+ fi
19+
1320key=$( jq -r .key $filename )
1421if [ -n " $key " ]; then
1522 TMP_KEY=$( mktemp)
2128
2229destination=$( jq -r .destination $filename )
2330
24- exec ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no " ${ssh_options[@]} " " $destination "
31+ exec $sshpass_command ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no " ${ssh_options[@]} " " $destination "
Original file line number Diff line number Diff line change 11if ! command -v ttyd & > /dev/null; then
22 echo " ttyd not found, installing..."
33 sudo apt update
4- sudo apt install -y ttyd
4+ sudo apt install -y ttyd sshpass
55fi
66
77if [ ! -x ssh_wrapper.sh ]; then
You can’t perform that action at this time.
0 commit comments