From c564828958d1295d29ba2ec6cd88e9cf6cceb8e3 Mon Sep 17 00:00:00 2001
From: Imran Hussain <imranh@sucs.org>
Date: Tue, 10 Nov 2015 22:20:56 +0000
Subject: [PATCH] Update setup.sh to check if the script is int eh right place
 in a better way

---
 setup.sh | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/setup.sh b/setup.sh
index 75f6a29..e37a403 100755
--- a/setup.sh
+++ b/setup.sh
@@ -3,11 +3,7 @@
 # Setup script for SUCS website in users' public_html dirs
 echo "SUCS website setup script"
 
-# (try and) make sure we're running this from the right place
-# SUCS website
-# ^ a nasty kludge cause I don't know how to do it more sensibly
-# test for the magic phrase on line 7 of this very file
-head -n 7 setup.sh 2> /dev/null | tail -n 1 | grep -q "SUCS website"
+ls $(pwd)/setup.sh &> /dev/null
 if [ $? -ne 0 ]; then echo "Please run this script from its containing directory"; exit; fi
 
 # generate correct .htaccess
-- 
GitLab