# HG changeset patch # User Franz Glasner # Date 1727627422 -7200 # Node ID 24129dd789f02d97245fa981e645d9c6a3e598bb # Parent 83e6237350e4ebf90456667c1954bd6427062460 Shellcheck for rc-scripts diff -r 83e6237350e4 -r 24129dd789f0 .shellcheckrc --- a/.shellcheckrc Sun Sep 29 17:55:06 2024 +0200 +++ b/.shellcheckrc Sun Sep 29 18:30:22 2024 +0200 @@ -11,6 +11,7 @@ source-path=SCRIPTDIR/../share/local-bsdtools source-path=SCRIPTDIR +source-path=/etc external-sources=true # $/${} is unnecessary on arithmetic variables diff -r 83e6237350e4 -r 24129dd789f0 files/fbhyve.in --- a/files/fbhyve.in Sun Sep 29 17:55:06 2024 +0200 +++ b/files/fbhyve.in Sun Sep 29 18:30:22 2024 +0200 @@ -28,6 +28,9 @@ # The default is $fbhyve_configdir/.conf # +# shellcheck disable=SC2034,SC2154,SC2223 + +# shellcheck disable=SC1094 # parsing fails: rc.subr contains unknown features . /etc/rc.subr name="fbhyve" @@ -74,6 +77,7 @@ _ec=0 _swap=$*; shift; _vmarglist=$* _vmlist=${_vmarglist:-${fbhyve_list}} + # shellcheck disable=SC2086 set -- ${_swap} for _vm in ${_vmlist}; do "$0" "$1" "${_vm}" @@ -109,7 +113,7 @@ _rc=1 fi - if ${command} has-session -t ${_session} 2>/dev/null; then + if ${command} has-session -t "${_session}" 2>/dev/null; then echo "tmux session ${_session} exists." if [ ${_rc} -gt 0 ]; then _rc=2 diff -r 83e6237350e4 -r 24129dd789f0 files/fwireguard.in --- a/files/fwireguard.in Sun Sep 29 17:55:06 2024 +0200 +++ b/files/fwireguard.in Sun Sep 29 18:30:22 2024 +0200 @@ -19,6 +19,9 @@ # NOTE: All wireguard interfaces must be mentioned fist in "cloned_interfaces". # +# shellcheck disable=SC2034,SC2129,SC2223,SC3037 + +# shellcheck disable=SC1094 # parsing fails: rc.subr contains unknown features . /etc/rc.subr name=fwireguard @@ -61,7 +64,7 @@ _f="${fwireguard_configdir}/${_if}.pub" if [ ! -f "${_f}" ]; then echo "Generating public key for ${_if} in ${_f}" - /usr/bin/wg pubkey < ${fwireguard_configdir}/${_if}.key > "${_f}" + /usr/bin/wg pubkey < "${fwireguard_configdir}/${_if}.key" > "${_f}" fi _f="${fwireguard_configdir}/${_if}.conf"