mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2024-11-28 08:52:00 +02:00
Merge pull request #5634 from torzech/proper-threads-regex
Enhanced regular expression for THREADS parameter
This commit is contained in:
commit
aadeeb0df3
@ -55,10 +55,10 @@ ENV_FILE=${SCRIPT_DIR}/../.env
|
|||||||
THREADS=$(echo ${THREADS:-1})
|
THREADS=$(echo ${THREADS:-1})
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
|
|
||||||
if ! [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then
|
if ! [[ "${THREADS}" =~ ^[1-9][0-9]?$ ]] ; then
|
||||||
echo "Thread input is not a number!"
|
echo "Thread input is not a number!"
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ "${THREADS}" =~ ^[1-9]+$ ]] ; then
|
elif [[ "${THREADS}" =~ ^[1-9][0-9]?$ ]] ; then
|
||||||
echo "Using ${THREADS} Thread(s) for this run."
|
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."
|
echo "Notice: You can set the Thread count with the THREADS Variable before you run this script."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user