From c6cea7c8e82d06b9f443e9537a921b3d180f93fa Mon Sep 17 00:00:00 2001 From: lazedo Date: Thu, 27 Feb 2020 19:15:36 +0000 Subject: [PATCH] validate public ip before using it --- system/sbin/kazoo-kamailio | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/sbin/kazoo-kamailio b/system/sbin/kazoo-kamailio index cf0db02..cbf0813 100755 --- a/system/sbin/kazoo-kamailio +++ b/system/sbin/kazoo-kamailio @@ -68,7 +68,9 @@ if [[ "${MY_PUBLIC_IP}" != "none" ]]; then else MY_PUBLIC_IP=$(dig @ns1.google.com TXT o-o.myaddr.l.google.com +short -4 2> /dev/null | sed s/\"//g ) if [[ ! -z ${MY_PUBLIC_IP} ]]; then - EXTRA_OPTIONS+=" -A MY_PUBLIC_IP=${MY_PUBLIC_IP} -A PUBLIC_IP_AUTO" + if is_ipaddress ${MY_PUBLIC_IP}; then + EXTRA_OPTIONS+=" -A MY_PUBLIC_IP=${MY_PUBLIC_IP} -A PUBLIC_IP_AUTO" + fi fi fi