diff --git a/nodemgmt-scripts.sh b/nodemgmt-scripts.sh index 5a6ce2ae..5b04be5b 100755 --- a/nodemgmt-scripts.sh +++ b/nodemgmt-scripts.sh @@ -2495,8 +2495,16 @@ UPDATEPUSHOVERINFO(){ if [ "${checkhost}" != "false" ]; then echo -e "${idsST[Bold]}${idsCL[LightCyan]} ${host_name[$hostid]} - Running commands${idsCL[Default]}${idsST[Reset]}" ssh root@${host_ip[$hostid]} "/bin/sed -i '/PUSHOVER_/d' /opt/idssys/nodemgmt/settings.conf" - [ "${PUSHOVER_APP_TOKEN}" != "" ] && ssh root@${host_ip[$hostid]} "echo PUSHOVER_APP_TOKEN=\\\"${PUSHOVER_APP_TOKEN}\\\" >> ${MMFOLDER}/settings.conf" || ssh root@${host_ip[$hostid]} echo "# PUSHOVER_APP_TOKEN=\\\"\\\" >> ${MMFOLDER}/settings.conf" - [ "${PUSHOVER_USER_TOKEN}" != "" ] && ssh root@${host_ip[$hostid]} "echo PUSHOVER_USER_TOKEN=\\\"${PUSHOVER_USER_TOKEN}\\\" >> ${MMFOLDER}/settings.conf" || ssh root@${host_ip[$hostid]} echo "# PUSHOVER_USER_TOKEN=\\\"\\\" >> ${MMFOLDER}/settings.conf" + if [ "${PUSHOVER_APP_TOKEN}" != "" ]; then + ssh root@${host_ip[$hostid]} "echo PUSHOVER_APP_TOKEN=\\\"${PUSHOVER_APP_TOKEN}\\\" >> ${MMFOLDER}/settings.conf" + else + ssh root@${host_ip[$hostid]} "echo # PUSHOVER_APP_TOKEN=\\\"\\\" >> ${MMFOLDER}/settings.conf" + fi + if [ "${PUSHOVER_USER_TOKEN}" != "" ]; then + ssh root@${host_ip[$hostid]} "echo PUSHOVER_USER_TOKEN=\\\"${PUSHOVER_USER_TOKEN}\\\" >> ${MMFOLDER}/settings.conf" + else + ssh root@${host_ip[$hostid]} "echo # PUSHOVER_USER_TOKEN=\\\"\\\" >> ${MMFOLDER}/settings.conf" + fi else echo -e "${idsST[Bold]}${idsCL[Red]} ${host_name[$hostid]} - Timeout${idsCL[Default]}${idsST[Reset]}"