#!/bin/sh
voip_dns_parse()
{
local voip_server_name=`echo ${QUERY_STRING} | cut -d ? -f 2`
echo "voip_server_name == ${voip_server_name}"> /dev/console
local voip_server_ip=''
local voip_server_ip1=''
local voip_server_ip2=''
voip_server_ip=`dns_parse ${voip_server_name}`
echo "voip_server_ip == ${voip_server_ip}"> /dev/console
voip_server_ip1=`echo ${voip_server_ip} | cut -d ? -f 2`
echo "voip_server_ip1 == ${voip_server_ip1}"> /dev/console
voip_server_ip2=`echo ${voip_server_ip} | cut -d ? -f 4`
echo "voip_server_ip2 == ${voip_server_ip2}"> /dev/console
cfgcmd set "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.RegistrarServer" "$voip_server_ip"
if [ "${voip_server_ip1}" == '' ]; then
cfgcmd set "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.X_TRI-illegal_SipAllowAddr" "0.0.0.0"
fi
cfgcmd set "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.X_TRI-illegal_SipAllowAddr" "$voip_server_ip1"
if [ "${voip_server_ip2}" == '' ]; then
cfgcmd set "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.X_TRI-illegal_SipAllowAddrBak" "0.0.0.0"
fi
cfgcmd set "InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.X_TRI-illegal_SipAllowAddrBak" "$voip_server_ip2"
}
echo "QUERY_STRING_origin == ${QUERY_STRING}"> /dev/console
QUERY_STRING=${QUERY_STRING//%23/#}
echo "QUERY_STRING == ${QUERY_STRING}"> /dev/console
gCmd=`echo ${QUERY_STRING} | cut -d ? -f 1`
echo "gCmd == ${gCmd}"> /dev/console
case "${gCmd}" in
"dns_parse")
voip_dns_parse()
;;
"lan")
lan_set
;;
"wireless")
wireless_set
;;
"voip")
voip_set
;;
*)
;;
esac
nvram commit
echo "Pragma: no-cache\n"
echo "Cache-control: no-cache\n"
echo "Content-type: text/html"
echo ""
echo "sucess"
shell 脚本dns_parse 解析url
最新推荐文章于 2024-08-23 15:11:22 发布