refactor(scripts): preserve exit codes (SC2320)

SC2320: Set error code to variable to preserve it after other commands.
This commit is contained in:
4s3ti 2023-03-16 01:17:50 +01:00
parent c9e2537c19
commit 50bc333962
No known key found for this signature in database
GPG key ID: AC2D3B898F96BC51
2 changed files with 4 additions and 2 deletions

View file

@ -36,12 +36,13 @@ debugFunc() {
echo "::: Generating Debug Output" echo "::: Generating Debug Output"
${SUDO} "${scriptDir}/${vpn}/pivpnDebug.sh" | tee /tmp/debug.log ${SUDO} "${scriptDir}/${vpn}/pivpnDebug.sh" | tee /tmp/debug.log
e="${?}"
echo "::: " echo "::: "
echo "::: Debug output completed above." echo "::: Debug output completed above."
echo "::: Copy saved to /tmp/debug.log" echo "::: Copy saved to /tmp/debug.log"
echo "::: " echo "::: "
exit "${?}" exit "${e}"
} }
removeOVPNFunc() { removeOVPNFunc() {

View file

@ -31,12 +31,13 @@ debug() {
echo "::: Generating Debug Output" echo "::: Generating Debug Output"
${SUDO} "${scriptdir}/${vpn}/pivpnDEBUG.sh" | tee /tmp/debug.log ${SUDO} "${scriptdir}/${vpn}/pivpnDEBUG.sh" | tee /tmp/debug.log
e="${?}"
echo "::: " echo "::: "
echo "::: Debug output completed above." echo "::: Debug output completed above."
echo "::: Copy saved to /tmp/debug.log" echo "::: Copy saved to /tmp/debug.log"
echo "::: " echo "::: "
exit "${?}" exit "${e}"
} }
listClients() { listClients() {