Group bash tests together

This commit is contained in:
Peter Ajamian 2021-06-13 00:36:43 +12:00
parent b587a7e7a4
commit 72927f398e

View File

@ -39,18 +39,18 @@ if [ -n "$POSIXLY_CORRECT" ] || [ -z "$BASH_VERSION" ]; then
exit 1 exit 1
fi fi
# Make sure we're root.
if (( EUID != 0 )); then
printf '%s\n' "You must run this script as root. Either use sudo or 'su -c ${0}'" >&2
exit 1
fi
# We need bash version >= 4 for associative arrays. # We need bash version >= 4 for associative arrays.
if (( BASH_VERSINFO < 4 )); then if (( BASH_VERSINFO < 4 )); then
printf '%s\n' "bash >= 4.0 is required for this script." >&2 printf '%s\n' "bash >= 4.0 is required for this script." >&2
exit 1 exit 1
fi fi
# Make sure we're root.
if (( EUID != 0 )); then
printf '%s\n' "You must run this script as root. Either use sudo or 'su -c ${0}'" >&2
exit 1
fi
# Path to logfile # Path to logfile
logfile=/var/log/migrate2rocky.log logfile=/var/log/migrate2rocky.log