diff --git a/update-motd.d/20-service b/update-motd.d/20-service index cc652a5..ede29dc 100755 --- a/update-motd.d/20-service +++ b/update-motd.d/20-service @@ -28,7 +28,7 @@ process_info() { for PROCESS in ${PROCESS_LIST}; do MSG="${MSG}${BLACKB}+ " PRINTF_PROCESS=$(printf '%-22s' "${PROCESS}") - if (ps ax | grep -v grep | grep -E "${PROCESS}" > /dev/null); then + if (ps ax | grep --invert-match grep | grep --word-regexp "${PROCESS}" > /dev/null); then MSG="${MSG}${WHITE}${PRINTF_PROCESS}${RESET}${BLACKB}= ${GREEN}RUNNING${RESET}" else MSG="${MSG}${WHITE}${PRINTF_PROCESS}${RESET}${BLACKB}= ${REDB}NOT RUNNING${RESET}" @@ -393,7 +393,7 @@ fi # Process need a warning if running [[[ YELLOW_PROCESS='tmux screen glances htop automysqlbackup vzdump puppet aptitude' for PROCESS in ${YELLOW_PROCESS}; do - if (ps ax | grep -v grep | grep "${PROCESS}" > /dev/null); then + if (ps ax | grep --invert-match grep | grep --word-regexp "${PROCESS}" > /dev/null); then PRINTF_PROCESS=$(printf '%-22s' "${PROCESS}") printf '%b' "\\n${BLACKB}+ ${WHITE}${PRINTF_PROCESS}${RESET}${BLACKB}= ${YELLOW}RUNNING${RESET}" fi