chore: Test and do not run against root.

This commit is contained in:
Kyle Gospodnetich 2024-04-15 12:04:57 -07:00
parent 18132ea917
commit ab2ba7a4d2
2 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,9 @@
#!/usr/bin/bash
if [ "$1" == "root" ]; then
echo "Do not run this for root."
exit 0
fi
systemctl enable --now hhd@$(systemd-escape $1).service
systemctl disable --now hhd@root.service

View File

@ -1,5 +1,10 @@
#!/usr/bin/bash
if [ "$EUID" == 0 ]; then
echo "Bazzite user setup ran as root user. Exiting."
exit 0
fi
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)