refactor: improve code style

Improve the code style of some pieces of code
This commit is contained in:
Giulio Coa 2022-08-09 10:09:25 +02:00
parent 9a7b7dfe72
commit dda4d99f10
9 changed files with 54 additions and 128 deletions

View file

@ -443,8 +443,7 @@ echo "tls Private Key found: ${TA}"
# Next append the client Public Cert
echo "<cert>"
sed \
-n \
sed -n \
-e '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' \
< "issued/${NAME}${CRT}"
echo "</cert>"
@ -517,8 +516,7 @@ for i in {2..254}; do
# disabling SC2514, variable sourced externaly
# shellcheck disable=SC2154
if [[ -z "$(ls -A /etc/openvpn/ccd)" ]] \
|| ! find /etc/openvpn/ccd \
-type f \
|| ! find /etc/openvpn/ccd -type f \
-exec grep -q "${NET_REDUCED}.${i}" {} +; then
COUNT="${i}"
echo -n "ifconfig-push ${NET_REDUCED}.${i}" >> /etc/openvpn/ccd/"${NAME}"