[SUCS Devel] [Git][sucssite/sucs-site][master] Update setup.sh to check if the script is int eh right place in a better way

Imran Hussain imranh at sucs.org
Tue Nov 10 22:21:00 GMT 2015


Imran Hussain pushed to branch master at sucssite / sucs-site


Commits:
c5648289 by Imran Hussain at 2015-11-10T22:20:56Z
Update setup.sh to check if the script is int eh right place in a better way
- - - - -


1 changed file:

- setup.sh


Changes:

=====================================
setup.sh
=====================================
--- 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



View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/commit/c564828958d1295d29ba2ec6cd88e9cf6cceb8e3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20151110/4571d0df/attachment.html>


More information about the Devel mailing list