summaryrefslogtreecommitdiff
path: root/sh/dnd
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-02-23 00:17:00 -0800
committerXiao Pan <xyz@flylightning.xyz>2025-02-23 00:17:00 -0800
commit354d39f9deb581b0256eea5ada402ead259ecff8 (patch)
tree6b87059d225c3b345c50e3c35063b2f6eb3329a8 /sh/dnd
parent40f0ebb1a69e4fc531a37102253ca6471c5d063e (diff)
Run `true` and `false` cli is slow
Diffstat (limited to 'sh/dnd')
-rwxr-xr-xsh/dnd6
1 files 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