diff --git a/cmd/zed/zed.d/data-email.sh b/cmd/zed/zed.d/data-email.sh index 9f83161494c2..f056ac803290 100755 --- a/cmd/zed/zed.d/data-email.sh +++ b/cmd/zed/zed.d/data-email.sh @@ -12,7 +12,7 @@ # 4: unsupported event class # 5: internal error # State File Format: -# POOL:TIME_OF_LAST_EMAIL +# POOL;TIME_OF_LAST_EMAIL # test -f "${ZED_SCRIPT_DIR}/zed.rc" && . "${ZED_SCRIPT_DIR}/zed.rc" @@ -47,7 +47,7 @@ flock -x 8 # Query state for last time email was sent for this pool. TIME_NOW=`date +%s` -TIME_LAST=`egrep "^${ZEVENT_POOL}:" "${STATEFILE}" 2>/dev/null | cut -d: -f2` +TIME_LAST=`egrep "^${ZEVENT_POOL};" "${STATEFILE}" 2>/dev/null | cut -d ";" -f2` if test -n "${TIME_LAST}"; then TIME_DELTA=`expr "${TIME_NOW}" - "${TIME_LAST}"` if test "${TIME_DELTA}" -lt "${ZED_EMAIL_INTERVAL_SECS:=3600}"; then @@ -67,8 +67,8 @@ EOF MAIL_STATUS=$? # Update state. -egrep -v "^${ZEVENT_POOL}:" "${STATEFILE}" 2>/dev/null > "${STATEFILE}.$$" -echo "${ZEVENT_POOL}:${TIME_NOW}" >> "${STATEFILE}.$$" +egrep -v "^${ZEVENT_POOL};" "${STATEFILE}" 2>/dev/null > "${STATEFILE}.$$" +echo "${ZEVENT_POOL};${TIME_NOW}" >> "${STATEFILE}.$$" mv -f "${STATEFILE}.$$" "${STATEFILE}" if test "${MAIL_STATUS}" -ne 0; then diff --git a/cmd/zed/zed.d/io-email.sh b/cmd/zed/zed.d/io-email.sh index 6cfe3c7f7fa9..f9759117512c 100755 --- a/cmd/zed/zed.d/io-email.sh +++ b/cmd/zed/zed.d/io-email.sh @@ -12,7 +12,7 @@ # 4: unsupported event class # 5: internal error # State File Format: -# POOL:VDEV_PATH:TIME_OF_LAST_EMAIL +# POOL;VDEV_PATH;TIME_OF_LAST_EMAIL # test -f "${ZED_SCRIPT_DIR}/zed.rc" && . "${ZED_SCRIPT_DIR}/zed.rc" @@ -49,8 +49,8 @@ flock -x 8 # Query state for last time email was sent for this pool/vdev. TIME_NOW=`date +%s` -TIME_LAST=`egrep "^${ZEVENT_POOL}:${ZEVENT_VDEV_PATH}:" "${STATEFILE}" \ - 2>/dev/null | cut -d: -f3` +TIME_LAST=`egrep "^${ZEVENT_POOL};${ZEVENT_VDEV_PATH};" "${STATEFILE}" \ + 2>/dev/null | cut -d ";" -f3` if test -n "${TIME_LAST}"; then TIME_DELTA=`expr "${TIME_NOW}" - "${TIME_LAST}"` if test "${TIME_DELTA}" -lt "${ZED_EMAIL_INTERVAL_SECS:=3600}"; then @@ -71,9 +71,9 @@ EOF MAIL_STATUS=$? # Update state. -egrep -v "^${ZEVENT_POOL}:${ZEVENT_VDEV_PATH}:" "${STATEFILE}" \ +egrep -v "^${ZEVENT_POOL};${ZEVENT_VDEV_PATH};" "${STATEFILE}" \ 2>/dev/null > "${STATEFILE}.$$" -echo "${ZEVENT_POOL}:${ZEVENT_VDEV_PATH}:${TIME_NOW}" >> "${STATEFILE}.$$" +echo "${ZEVENT_POOL};${ZEVENT_VDEV_PATH};${TIME_NOW}" >> "${STATEFILE}.$$" mv -f "${STATEFILE}.$$" "${STATEFILE}" if test "${MAIL_STATUS}" -ne 0; then