Skip to content

Commit

Permalink
refactor: shellcheck SC2086
Browse files Browse the repository at this point in the history
Double quote to prevent globbing and word splitting.
  • Loading branch information
toulousain79 committed Sep 22, 2024
1 parent 06a7c39 commit 886a508
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions P2Partisan/p2partisan.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# shellcheck disable=SC1091,SC2002,SC2003,SC2009,SC2012,SC2126
# shellcheck disable=SC1091,SC2002,SC2003,SC2009,SC2012,SC2126,SC2086
#
# p2partisan v6.10 (2021/06/27)
#
Expand Down Expand Up @@ -629,7 +629,7 @@ $(iptables -L | grep "${name}")
grep -Ev "^#|^$" ./blacklists | tr -d "\r" |
(
while read -r line; do
counter=$(expr ${counter} + 1)
counter=$(expr "${counter}" + 1)
counter=$(printf "%02d" "${counter}")
name=$(echo "${line}" | awk '{print $1}')
statusa=$(cat /tmp/p2partisan."${name}".LOAD 2>/dev/null || echo 5)
Expand Down Expand Up @@ -1232,7 +1232,7 @@ function pgreylist() {
done
}
elif [[ ${q} -eq 1 ]]; then
nslookup "${IP}" ${sDNS} | grep "Address [0-9]*:" | grep -v 127.0.0.1 | grep -v "\:\:" | grep -Eo "([0-9\.]{7,15})" |
nslookup "${IP}" "${sDNS}" | grep "Address [0-9]*:" | grep -v 127.0.0.1 | grep -v "\:\:" | grep -Eo "([0-9\.]{7,15})" |
while read -r IPO; do
ipset -A greylist "${IPO%*/32}" 2>/dev/null
done
Expand Down Expand Up @@ -1266,7 +1266,7 @@ function pblacklistcustom() {
done
}
elif [[ ${q} -eq 1 ]]; then
nslookup "${IP}" ${sDNS} | grep "Address [0-9]*:" | grep -v 127.0.0.1 | grep -v "\:\:" | grep -Eo "([0-9\.]{7,15})" |
nslookup "${IP}" "${sDNS}" | grep "Address [0-9]*:" | grep -v 127.0.0.1 | grep -v "\:\:" | grep -Eo "([0-9\.]{7,15})" |
while read -r IPO; do
ipset -A blacklist-custom "${IPO%*/32}" 2>/dev/null
done
Expand Down
2 changes: 1 addition & 1 deletion root/TEMPLATEs/init/rc.unslung.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ case "$ACTION" in
'stop' | 'restart' | 'kill') ORDER="-r" ;;
esac

for i in $(find /opt/etc/init.d/ -perm '-u+x' -name 'S*' | sort $ORDER); do
for i in $(find /opt/etc/init.d/ -perm '-u+x' -name 'S*' | sort "$ORDER"); do
logger -p user.notice "| $(basename "$0") |" "Beginning $ACTION sequence for '$(basename "$i")'"

LOOP=1 # Permit to avoid loop for some sourced scripts !!!
Expand Down

0 comments on commit 886a508

Please sign in to comment.