Skip to content

Commit

Permalink
Merge pull request #5634 from torzech/proper-threads-regex
Browse files Browse the repository at this point in the history
Enhanced regular expression for THREADS parameter
  • Loading branch information
DerLinkman authored Jul 9, 2024
2 parents b9ae174 + 6dc0bdb commit aadeeb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helper-scripts/backup_and_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ ENV_FILE=${SCRIPT_DIR}/../.env
THREADS=$(echo ${THREADS:-1})
ARCH=$(uname -m)

if ! [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then
if ! [[ "${THREADS}" =~ ^[1-9][0-9]?$ ]] ; then
echo "Thread input is not a number!"
exit 1
elif [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then
elif [[ "${THREADS}" =~ ^[1-9][0-9]?$ ]] ; then
echo "Using ${THREADS} Thread(s) for this run."
echo "Notice: You can set the Thread count with the THREADS Variable before you run this script."
fi
Expand Down

0 comments on commit aadeeb0

Please sign in to comment.