Update mosdns.sh

This commit is contained in:
Bard 2023-01-10 23:28:26 +08:00 committed by GitHub
parent 6887e0b0b6
commit 4cbf23597c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,7 @@
#!/bin/sh #!/bin/sh
script_action=${1}
logfile_path() ( logfile_path() (
configfile=$(uci -q get mosdns.config.configfile) configfile=$(uci -q get mosdns.config.configfile)
if [ "$configfile" = "/etc/mosdns/config.yaml" ]; then if [ "$configfile" = "/etc/mosdns/config.yaml" ]; then
@ -78,14 +80,23 @@ geodat_update() (
rm -rf "$TMPDIR" rm -rf "$TMPDIR"
) )
if [ "$1" == "dns" ]; then case $script_action in
interface_dns "dns")
elif [ "$1" == "ad" ]; then interface_dns
ad_block ;;
elif [ "$1" == "geodata" ]; then "ad")
geodat_update && adlist_update ad_block
elif [ "$1" == "logfile" ]; then ;;
logfile_path "geodata")
elif [ "$1" == "adlist_update" ]; then geodat_update && adlist_update
adlist_update ;;
fi "logfile")
logfile_path
;;
"adlist_update")
adlist_update
;;
*)
exit 0
;;
esac