Fix bug.
This commit is contained in:
parent
aa948dc590
commit
97ec8056d6
|
@ -25,6 +25,8 @@ if [[ ! -z "$9" ]]; then
|
||||||
if [[ -z "$new_server_port" ]]; then
|
if [[ -z "$new_server_port" ]]; then
|
||||||
new_server_port="80";
|
new_server_port="80";
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
new_server_port="80";
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
domain_escape=`echo $domain|sed 's/\./\\\./g'`;
|
domain_escape=`echo $domain|sed 's/\./\\\./g'`;
|
||||||
|
@ -38,7 +40,7 @@ else
|
||||||
ssh_command="sshpass -p $pass ssh $user@$ip -p $port";
|
ssh_command="sshpass -p $pass ssh $user@$ip -p $port";
|
||||||
scp_command="sshpass -p $pass scp -r -P $port $user@$ip:";
|
scp_command="sshpass -p $pass scp -r -P $port $user@$ip:";
|
||||||
scan_ssh_keys=`ssh-keyscan -H $ip -p $port`
|
scan_ssh_keys=`ssh-keyscan -H $ip -p $port`
|
||||||
if [ -z "$(grep -w "$scan_ssh_keys" ~/.ssh/known_hosts)" ]; then
|
if [[ ! -e ~/.ssh/known_hosts ]] || [[ -z "$(grep -w "$scan_ssh_keys" ~/.ssh/known_hosts)" ]]; then
|
||||||
echo "$scan_ssh_keys" >> ~/.ssh/known_hosts
|
echo "$scan_ssh_keys" >> ~/.ssh/known_hosts
|
||||||
fi
|
fi
|
||||||
use_local_command=""
|
use_local_command=""
|
||||||
|
|
|
@ -28,6 +28,8 @@ if [[ ! -z "$tmp" ]]; then
|
||||||
if [[ -z "$new_server_port" ]]; then
|
if [[ -z "$new_server_port" ]]; then
|
||||||
new_server_port="80";
|
new_server_port="80";
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
new_server_port="80";
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
tmp="";
|
tmp="";
|
||||||
|
@ -42,7 +44,7 @@ else
|
||||||
ssh_command="sshpass -p $pass ssh $user@$ip -p $port";
|
ssh_command="sshpass -p $pass ssh $user@$ip -p $port";
|
||||||
scp_command="sshpass -p $pass scp -r -P $port $user@$ip:";
|
scp_command="sshpass -p $pass scp -r -P $port $user@$ip:";
|
||||||
scan_ssh_keys=`ssh-keyscan -H $ip -p $port`
|
scan_ssh_keys=`ssh-keyscan -H $ip -p $port`
|
||||||
if [ -z "$(grep -w "$scan_ssh_keys" ~/.ssh/known_hosts)" ]; then
|
if [[ ! -e ~/.ssh/known_hosts ]] || [[ -z "$(grep -w "$scan_ssh_keys" ~/.ssh/known_hosts)" ]]; then
|
||||||
echo "$scan_ssh_keys" >> ~/.ssh/known_hosts
|
echo "$scan_ssh_keys" >> ~/.ssh/known_hosts
|
||||||
fi
|
fi
|
||||||
use_local_command=""
|
use_local_command=""
|
||||||
|
|
Loading…
Reference in New Issue