|
@ -138,13 +138,13 @@ f_envparse() |
|
|
done |
|
|
done |
|
|
elif [ "${config}" = "wancheck" ] |
|
|
elif [ "${config}" = "wancheck" ] |
|
|
then |
|
|
then |
|
|
unset adb_wandev |
|
|
|
|
|
|
|
|
unset adb_wandev 2>/dev/null |
|
|
elif [ "${config}" = "ntpcheck" ] |
|
|
elif [ "${config}" = "ntpcheck" ] |
|
|
then |
|
|
then |
|
|
unset adb_ntpsrv |
|
|
|
|
|
|
|
|
unset adb_ntpsrv 2>/dev/null |
|
|
elif [ "${config}" = "shalla" ] |
|
|
elif [ "${config}" = "shalla" ] |
|
|
then |
|
|
then |
|
|
unset adb_cat_shalla |
|
|
|
|
|
|
|
|
unset adb_cat_shalla 2>/dev/null |
|
|
fi |
|
|
fi |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -157,7 +157,7 @@ f_envparse() |
|
|
# set temp variables and counter |
|
|
# set temp variables and counter |
|
|
# |
|
|
# |
|
|
adb_tmpfile="$(mktemp -tu 2>/dev/null)" |
|
|
adb_tmpfile="$(mktemp -tu 2>/dev/null)" |
|
|
adb_tmpdir="$(mktemp -d 2>/dev/null)" |
|
|
|
|
|
|
|
|
adb_tmpdir="$(mktemp -p /tmp -d 2>/dev/null)" |
|
|
|
|
|
|
|
|
# set adblock source ruleset definitions |
|
|
# set adblock source ruleset definitions |
|
|
# |
|
|
# |
|
@ -173,14 +173,6 @@ f_envparse() |
|
|
# |
|
|
# |
|
|
adb_dnsfile="/tmp/dnsmasq.d/adlist.conf" |
|
|
adb_dnsfile="/tmp/dnsmasq.d/adlist.conf" |
|
|
adb_dnsformat="sed 's/^/address=\//;s/$/\/'${adb_ip}'/'" |
|
|
adb_dnsformat="sed 's/^/address=\//;s/$/\/'${adb_ip}'/'" |
|
|
|
|
|
|
|
|
# remove unused environment variables |
|
|
|
|
|
# |
|
|
|
|
|
env_list="$(set | grep -o "CONFIG_[A-Za-z_]*")" |
|
|
|
|
|
for var in ${env_list} |
|
|
|
|
|
do |
|
|
|
|
|
unset "${var}" 2>/dev/null |
|
|
|
|
|
done |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
############################################# |
|
|
############################################# |
|
@ -294,11 +286,11 @@ f_envcheck() |
|
|
check="$(printf "${pkg_list}" | grep "^ca-certificates -")" |
|
|
check="$(printf "${pkg_list}" | grep "^ca-certificates -")" |
|
|
if [ -z "${check}" ] |
|
|
if [ -z "${check}" ] |
|
|
then |
|
|
then |
|
|
curl_parm="--insecure" |
|
|
|
|
|
wget_parm="--no-check-certificate" |
|
|
|
|
|
|
|
|
curl_parm="-q --insecure" |
|
|
|
|
|
wget_parm="--no-config --no-check-certificate" |
|
|
else |
|
|
else |
|
|
unset curl_parm |
|
|
|
|
|
unset wget_parm |
|
|
|
|
|
|
|
|
curl_parm="-q" |
|
|
|
|
|
wget_parm="--no-config" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# check total and swap memory |
|
|
# check total and swap memory |
|
@ -424,6 +416,16 @@ f_envcheck() |
|
|
f_remove |
|
|
f_remove |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# remove no longer used environment variables |
|
|
|
|
|
# |
|
|
|
|
|
env_list="$(set | grep -o "CONFIG_[A-Za-z0-9_]*")" |
|
|
|
|
|
for var in ${env_list} |
|
|
|
|
|
do |
|
|
|
|
|
unset "${var}" 2>/dev/null |
|
|
|
|
|
done |
|
|
|
|
|
unset env_list 2>/dev/null |
|
|
|
|
|
unset pkg_list 2>/dev/null |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
################################################ |
|
|
################################################ |
|
@ -495,10 +497,10 @@ f_deltemp() |
|
|
rm -f "${adb_tmpfile}" >/dev/null 2>&1 |
|
|
rm -f "${adb_tmpfile}" >/dev/null 2>&1 |
|
|
fi |
|
|
fi |
|
|
if [ -d "${adb_tmpdir}" ] |
|
|
if [ -d "${adb_tmpdir}" ] |
|
|
then |
|
|
|
|
|
|
|
|
then |
|
|
rm -rf "${adb_tmpdir}" >/dev/null 2>&1 |
|
|
rm -rf "${adb_tmpdir}" >/dev/null 2>&1 |
|
|
fi |
|
|
fi |
|
|
f_log "domain adblock processing finished (${adb_version})" |
|
|
|
|
|
|
|
|
f_log "domain adblock processing finished (${adb_version}, ${openwrt_version})" |
|
|
exit ${rc} |
|
|
exit ${rc} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|