readd root for running the script

Signed-off-by: Tobias Powalowski <tpowa@archlinux.org>
This commit is contained in:
Tobias Powalowski 2021-09-10 13:40:49 +02:00
parent a1e1fd89ce
commit 54f0a0454d

View file

@ -50,6 +50,12 @@ while [ $# -gt 0 ]; do
shift shift
done done
### check for root
if ! [[ ${UID} -eq 0 ]]; then
echo "ERROR: Please run as root user!"
exit 1
fi
# set defaults, if nothing given # set defaults, if nothing given
[[ -z "${RELEASENAME}" ]] && RELEASENAME="$(date +%Y%m%d-%H%M)" [[ -z "${RELEASENAME}" ]] && RELEASENAME="$(date +%Y%m%d-%H%M)"
[[ -z "${IMAGENAME}" ]] && IMAGENAME="archlinux-${RELEASENAME}-archboot" [[ -z "${IMAGENAME}" ]] && IMAGENAME="archlinux-${RELEASENAME}-archboot"