diff --git a/install.sh b/install.sh index 7070b41..709a4f5 100755 --- a/install.sh +++ b/install.sh @@ -35,6 +35,18 @@ if [[ $EUID -ne 0 ]]; then exit 1 fi +# Make sure we're running in our git directory +if [ ! -d .git ]; then + echo "It doesn't seem we're running from the right place. Please make sure you are running from the brewpi-tools directory" + exit 1 +fi + +owner=$( stat -c "%U" . ) +if [ "$owner" != "pi" ] && [ "$owner" != "brewpi" ]; then + echo "This script needs to run from either the pi or brewpi userspace- try moving these files to /home/pi and running again" + exit 1 +fi + ############ ### Functions to catch/display errors during setup ############