make sure that $1 is a real user

This commit is contained in:
Pratham Patel 2023-11-20 17:52:32 +05:30
parent e99df742a1
commit cfc7064964
No known key found for this signature in database

View File

@ -15,6 +15,13 @@ for COMMAND in "${COMMANDS_TO_CHECK[@]}"; do
fi
done
if [[ -n "$1" ]]; then
GUSER="^$1"
if ! grep $GUSER /etc/shadow > /dev/null; then
>&2 echo "$0: ERROR: unable to find user '$1'"
fi
fi
function create_new_image {
UBOOT_MAX_SIZE='32'
IMAGE_SIZE=$(( $(stat -c '%s' "${IMAGE_NAME}") / 1024 / 1024 ))