NTP offset monitoring bash script

#!/bin/bash
# Created by Rodel
# 27/08/2020
MAIL=`which mail`
THIS_SERVER=`hostname -s`
RCPTS="rodel@test.com"
check_ntp_return_value () {
        ntpq_count=$(ntpq  -p |grep  -e '*'|awk  '{print $9}' | wc -l)
#       ntpq_count="0"
        if [ "$ntpq_count" -ne "0" ];
                then
                        check_ntp_offset;
                else
                        message=$(echo "No NTP master ip address assign <example: *192.168.0.x>. Please login to the server and check. Thank you.")
                        send_email "$message";
        fi
}
check_ntp_offset () {
        ntpq_p=$(ntpq  -p |grep  -e '*'|awk  '{print $9}')
        ntpq_p=${ntpq_p%.*}
#       ntpq_p="6001"
        ntpq_server=$(ntpq  -pn |grep  -e '*'|awk  '{print $1}' | sed 's/*//g')
        if [ "$ntpq_p" -gt "6000" ];
                then
                        message1=$(echo "Critical - `hostname` Offset value is $ntpq_p greater than 6000 milliseconds")
                        message2=$(ntp_sync)
                                                send_email "$message1 \n\n Executing ntpdate...\n$message2";
                else
                        exit 0
        fi
}

ntp_sync () {
#       ntpdate -q $ntpq_server >> /dev/null 2>&1
        ntpdate -q $ntpq_server
}
send_email () {
        STR2="${1}"
        echo -e "${STR2}" | ${MAIL} -s "[${THIS_SERVER}] NTP Synchronization Alert" "${RCPTS}"
}
check_ntp_return_value