try to avoid broken installs

This commit is contained in:
frederik
2024-02-16 11:52:08 +01:00
parent 819f390614
commit bff4c3f377
+14
View File
@@ -14,6 +14,20 @@ information"
exit 1
fi
# we require passwordless sudo
sudo -K
if ! sudo -n true; then
echo "Passwordless sudo is not working. Aborting"
exit
fi
# the php code expects the user with uid 1000 on this system
PRIMARY=$(awk -F: '/1000/{print $1}' /etc/passwd)
if [ $USER != $PRIMARY ]; then
echo "Current user \"$USER\" does not match the user with uid 1000 on this system \"$PRIMARY\". Aborting"
exit
fi
# Simple new installer
HOME=$HOME
USER=$USER