- Add ip library,
- Move ip low level functions to ip library, - Add libs RPM package.
This commit is contained in:
@@ -36,7 +36,7 @@ fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
: "${RX3_LIB_DIR:=/usr/lib/rx3}"
|
||||
. "${RX3_LIB_DIR}/base.bash"
|
||||
. "${RX3_LIB_DIR}/ip.bash"
|
||||
|
||||
|
||||
|
||||
@@ -47,13 +47,13 @@ fi
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
declare -Ag DNS_A_TAB
|
||||
declare -g DNS_A_ID_LIST
|
||||
declare -g DNS_A_ID_LIST=""
|
||||
|
||||
declare -Ag DNS_PTR_TAB
|
||||
declare -g DNS_PTR_ID_LIST
|
||||
declare -g DNS_PTR_ID_LIST=""
|
||||
|
||||
declare -g DNS_CACHE_FILE
|
||||
declare -g DNS_CACHE_LOCK
|
||||
declare -g DNS_CACHE_FILE=""
|
||||
declare -g DNS_CACHE_LOCK=""
|
||||
#declare -g DNS_CACHE_LOCK="${DNS_CACHE_FILE}"
|
||||
|
||||
declare -g DNS_CACHE_UPDATED=0
|
||||
@@ -224,19 +224,19 @@ dns_lookup()
|
||||
|
||||
if [[ "${dl_flag}" != "NOCACHE" ]]
|
||||
then
|
||||
dns_tab_get ${dl_type} ${dl_key}
|
||||
{ dns_tab_get ${dl_type} ${dl_key}; rc=$?; } || true
|
||||
else
|
||||
false
|
||||
rc=1
|
||||
fi
|
||||
|
||||
if [[ "$?" != "0" ]]
|
||||
if [[ "${rc}" != "0" ]]
|
||||
then
|
||||
log_trace "DNS" "Out of Cache: Type: [${dl_type}] Key: [${dl_key}] Flag: [${dl_flag}]"
|
||||
#log_trace "DNS" "Out of Cache: Type: [${dl_type}] Key: [${dl_key}] Flag: [${dl_flag}]"
|
||||
|
||||
case ${dl_type}
|
||||
in
|
||||
"A")
|
||||
dns_value="$( dig +short ${dl_key} 2>/dev/null)"
|
||||
dns_value="$( dig +short ${dl_key} 2>/dev/null | ip_ip_filter)"
|
||||
;;
|
||||
|
||||
"PTR")
|
||||
@@ -333,8 +333,8 @@ dns_host_update()
|
||||
|
||||
dns_init()
|
||||
{
|
||||
file_dir_init ${DNS_CACHE_FILE} root apache
|
||||
file_dir_init ${DNS_CACHE_LOCK} root apache
|
||||
file_dir_init "${DNS_CACHE_FILE}" root apache
|
||||
file_dir_init "${DNS_CACHE_LOCK}" root apache
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user