Only generate configuration for members who have a www directory
authorZachary Seguin <ztseguin@csclub.uwaterloo.ca>
Sat, 5 Dec 2015 21:11:28 +0000 (16:11 -0500)
committerZachary Seguin <ztseguin@csclub.uwaterloo.ca>
Sat, 5 Dec 2015 21:11:28 +0000 (16:11 -0500)
disable-webspace

index bef0987..9e65341 100755 (executable)
@@ -50,12 +50,14 @@ ldapsearch -xb "ou=People,dc=csclub,dc=uwaterloo,dc=ca" "(&${TERM_FILTER}(object
 # Generate Apache config
 #
 for uid in $(cat ${EXPIRED_USERS}); do
-   echo "<Directory /users/${uid}/www>"
-   echo "    AllowOverride None"
-   echo "    RewriteEngine On"
-   echo "    RewriteRule . ${DISABLED_PAGE} [L]"
-   echo "</Directory>"
-   echo ""
+   if [ -d /users/${uid}/www ]; then
+      echo "<Directory /users/${uid}/www>"
+      echo "    AllowOverride None"
+      echo "    RewriteEngine On"
+      echo "    RewriteRule . ${DISABLED_PAGE} [L]"
+      echo "</Directory>"
+      echo ""
+   fi
 done
 
 rm -f ${EXPIRED_USERS}