comparison files/fwireguard.in @ 665:24129dd789f0

Shellcheck for rc-scripts
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 29 Sep 2024 18:30:22 +0200
parents c3125616d0ec
children
comparison
equal deleted inserted replaced
664:83e6237350e4 665:24129dd789f0
17 # wireguard interfaces to be handled 17 # wireguard interfaces to be handled
18 # 18 #
19 # NOTE: All wireguard interfaces must be mentioned fist in "cloned_interfaces". 19 # NOTE: All wireguard interfaces must be mentioned fist in "cloned_interfaces".
20 # 20 #
21 21
22 # shellcheck disable=SC2034,SC2129,SC2223,SC3037
23
24 # shellcheck disable=SC1094 # parsing fails: rc.subr contains unknown features
22 . /etc/rc.subr 25 . /etc/rc.subr
23 26
24 name=fwireguard 27 name=fwireguard
25 desc="Wireguard startup helper" 28 desc="Wireguard startup helper"
26 rcvar=fwireguard_enable 29 rcvar=fwireguard_enable
59 fi 62 fi
60 63
61 _f="${fwireguard_configdir}/${_if}.pub" 64 _f="${fwireguard_configdir}/${_if}.pub"
62 if [ ! -f "${_f}" ]; then 65 if [ ! -f "${_f}" ]; then
63 echo "Generating public key for ${_if} in ${_f}" 66 echo "Generating public key for ${_if} in ${_f}"
64 /usr/bin/wg pubkey < ${fwireguard_configdir}/${_if}.key > "${_f}" 67 /usr/bin/wg pubkey < "${fwireguard_configdir}/${_if}.key" > "${_f}"
65 fi 68 fi
66 69
67 _f="${fwireguard_configdir}/${_if}.conf" 70 _f="${fwireguard_configdir}/${_if}.conf"
68 if [ ! -f "${_f}" ]; then 71 if [ ! -f "${_f}" ]; then
69 echo "Generating minimal config for ${_if} in ${_f}" 72 echo "Generating minimal config for ${_if} in ${_f}"