set -eE -o pipefail
trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?"' ERR
-cd "${BASH_SOURCE%/*}"
+cd $(dirname $(readlink -f "$BASH_SOURCE"))
export ROOTPW="$1"
export hostname="$2"
# https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Keyfiles
cp /root/luks/host-$hostname /mnt/crypto_keyfile.bin
+chmod 600 /mnt/crypto_keyfile.bin
shopt -s extglob