Support DNS Over HTTPS
This commit is contained in:
@@ -5,6 +5,19 @@ chmod +x /etc/init.d/smartdns
|
||||
mkdir -p /var/etc/smartdns/
|
||||
|
||||
[ "${IPKG_NO_SCRIPT}" = "1" ] && exit 0
|
||||
|
||||
if [ ! -f "/var/etc/smartdns/address.conf" ]; then
|
||||
cp /etc/smartdns/address.conf /var/etc/smartdns/address.conf
|
||||
fi
|
||||
|
||||
if [ ! -f "/var/etc/smartdns/blacklist-ip.conf" ]; then
|
||||
cp /etc/smartdns/blacklist-ip.conf /var/etc/smartdns/blacklist-ip.conf
|
||||
fi
|
||||
|
||||
if [ ! -f "/var/etc/smartdns/custom.conf" ]; then
|
||||
cp /etc/smartdns/custom.conf /var/etc/smartdns/custom.conf
|
||||
fi
|
||||
|
||||
. ${IPKG_INSTROOT}/lib/functions.sh
|
||||
default_postinst $0 $@
|
||||
ret=$?
|
||||
|
||||
@@ -155,9 +155,11 @@ load_server()
|
||||
SERVER="server-tcp"
|
||||
elif [ "$type" = "tls" ]; then
|
||||
SERVER="server-tls"
|
||||
elif [ "$type" = "https" ]; then
|
||||
SERVER="server-https"
|
||||
fi
|
||||
|
||||
if [ ! -z "`echo $ip | grep ":"`" ]; then
|
||||
if [ ! -z "`echo $ip | grep ":" | grep -v "https://"`" ]; then
|
||||
if [ -z "`echo $ip | grep "\["`" ]; then
|
||||
ip="[$ip]"
|
||||
fi
|
||||
@@ -185,6 +187,10 @@ load_server()
|
||||
DNS_ADDRESS="$ip"
|
||||
fi
|
||||
|
||||
if [ "$type" = "https" ]; then
|
||||
DNS_ADDRESS="$ip"
|
||||
fi
|
||||
|
||||
conf_append "$SERVER" "$DNS_ADDRESS $ADDITIONAL_ARGS $addition_arg"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user