check pacstrap is run as root, print umask

This commit is contained in:
Stefan Agner 2019-01-24 14:17:25 +01:00
parent 2525e86aed
commit f463a85205

View file

@ -4,6 +4,12 @@
newroot=$1; shift newroot=$1; shift
pacman_args=("${@:-base}") pacman_args=("${@:-base}")
if [[ $EUID -ne 0 ]]; then
die "This script must be run as root"
fi
umask
[[ -d $newroot ]] || die "%s is not a directory" "$newroot" [[ -d $newroot ]] || die "%s is not a directory" "$newroot"
echo 'Creating install root at %s' "$newroot" echo 'Creating install root at %s' "$newroot"