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
"dns")
interface_dns interface_dns
elif [ "$1" == "ad" ]; then ;;
"ad")
ad_block ad_block
elif [ "$1" == "geodata" ]; then ;;
"geodata")
geodat_update && adlist_update geodat_update && adlist_update
elif [ "$1" == "logfile" ]; then ;;
"logfile")
logfile_path logfile_path
elif [ "$1" == "adlist_update" ]; then ;;
"adlist_update")
adlist_update adlist_update
fi ;;
*)
exit 0
;;
esac