From 98b91c4d5e103eeace449f400f9b3501d3909d51 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 17 Aug 2024 18:50:02 -0300 Subject: [PATCH] Fix shellcheck errors --- libexec/portzap/commands/portzap-teardown | 6 +++--- libexec/portzap/setup/setup-doas | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libexec/portzap/commands/portzap-teardown b/libexec/portzap/commands/portzap-teardown index 5bf6fef..dcab12b 100755 --- a/libexec/portzap/commands/portzap-teardown +++ b/libexec/portzap/commands/portzap-teardown @@ -15,9 +15,9 @@ user=_portzap ## # main if [ "$(id -u)" = "0" ]; then - pw userdel -n "${user}" || true - pw groupdel -n "${user}" || true - rm -rf /home/"${user}"/ || true + pw userdel -n "${user}" || true + pw groupdel -n "${user}" || true + rm -rf /home/"${user:?}"/ || true printok "done" else printerr "you must be root" diff --git a/libexec/portzap/setup/setup-doas b/libexec/portzap/setup/setup-doas index 5701815..78d8f00 100644 --- a/libexec/portzap/setup/setup-doas +++ b/libexec/portzap/setup/setup-doas @@ -16,8 +16,7 @@ sharedir="${localbase}"/share/portzap # main src="${sharedir}"/doas.conf dest="${localbase}"/etc/doas.conf -cat "${src}" | -while read -r line; do +while read -r line < "${src}"; do if grep -q "${line}" "${dest}"; then continue fi