Update dsmon.sh

This commit is contained in:
2023-07-04 20:58:56 -05:00
parent 783f5e500b
commit fb4e2c7fe6

View File

@@ -334,7 +334,16 @@ GETCRONTAB(){
apt install -yq sshpass > /dev/null 2>&1
fi
hostname=$(hostname)
crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@10.10.10.50 "cat > /opt/idssys/nodemgmt/crontabs/${hostname}.crontab"
if [ "$(CHECK_HOST 10.10.10.50)" != "false" ]; then
nmip=10.10.10.50
elif [ "$(CHECK_HOST 100.100.55.1)" != "false" ]; then
nmip=100.100.55.1
else
nmip=
fi
[ "${nmip}" != "" ] && crontab -l | sshpass -p${1} ssh -o 'StrictHostKeyChecking no' nm_crontab_user@${nmip} "cat > /opt/idssys/nodemgmt/crontabs/${hostname}.crontab"
}