code cleanup and small refactoring

This commit is contained in:
nom3ad
2024-01-07 21:32:50 +05:30
committed by Brian May
parent de8a19ce69
commit 72060abbef
6 changed files with 73 additions and 63 deletions

View File

@ -58,7 +58,7 @@ else
host=$node
fi
if [[ "${args[$((${#args[@]} - 1))]}" != *.* && "${args[$((${#args[@]} - 1))]}" != *:* ]]; then
if [[ "${#args[@]}" -ne 0 && "${args[$((${#args[@]} - 1))]}" != *.* && "${args[$((${#args[@]} - 1))]}" != *:* ]]; then
echo "No subnet specified. Using -N" >&2
args+=('-N')
fi