Fix double quoting, suggested by shellcheck
[drupal-init-tools.git] / libexec / new.sh
index 012c3cb..2064c89 100755 (executable)
@@ -20,7 +20,7 @@ set -e
 
 usage() {
   cat <<EOF
-usage: drin $(basename $0 .sh) [-h|--help] <destdir>
+usage: drin $(basename "$0" .sh) [-h|--help] <destdir>
 
 Create a new Drupal project in the 'destdir' directory.
 
@@ -116,6 +116,17 @@ EOF
 
 echo
 echo "Uncomment and customize the values in the bootstrap.conf file."
-echo "Make sure that access to '$PWD' is restricted by the web server."
+
+# Add some basic access control to protect sensitive files like bootstrap.conf
+cat > .htaccess <<EOF
+Options -Indexes
+SetEnvIf Request_URI "/web(/.*)?$" access_granted
+Order allow,deny
+Allow from env=access_granted
+EOF
+
+echo
+echo "Double check the provided .htaccess file to make sure that access to"
+echo "'$PWD' is restricted by the web server."
 
 popd