From 354d39f9deb581b0256eea5ada402ead259ecff8 Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 23 Feb 2025 00:17:00 -0800 Subject: Run `true` and `false` cli is slow --- sh/dnd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sh/dnd b/sh/dnd index da1d48f..a2d2944 100755 --- a/sh/dnd +++ b/sh/dnd @@ -5,9 +5,9 @@ cache=false if resolvectl status >/dev/null 2>&1; then - resolved=true + resolved=1 else - resolved=false + resolved= fi while getopts c opt; do @@ -27,7 +27,7 @@ else fi for domain in www.google.com www.baidu.com github.com gitlab.com codeberg.org www.douyu.com flylightning.xyz mirrors.flylightning.xyz git.flylightning.xyz mail.flylightning.xyz one.sjsu.edu discord.com www.youtube.com mail.google.com mail.yahoo.com en.wikipedia.org zh.wikipedia.org archlinux.org gitlab.archlinux.org aur.archlinux.org wiki.archlinux.org wiki.gentoo.org unix.stackexchange.com stackoverflow.com superuser.com www.reddit.com kyun.host panel.ihostart.com virt.crunchbits.com; do - if "$resolved"; then + if [ "$resolved" ]; then # awk substr and length: # https://stackoverflow.com/a/14840991 # https://unix.stackexchange.com/a/305192 -- cgit v1.2.3-70-g09d2