Avoid using PHP for the expired sites
[public/expire-sites.git] / generate-expire-config
index 86c807a..aa41a92 100755 (executable)
@@ -3,6 +3,7 @@
 #
 # CONFIGURATION
 #
+LANG=C
 DISABLED_PAGE=/~sysadmin/expired/index.php
 WHITELIST="ctdalek"
 #
@@ -28,7 +29,7 @@ if [ ${TERM_START_MONTH} -eq 1 ]; then
    fi
 elif [ ${TERM_START_MONTH} -eq 5 ]; then
    if [ ${MONTH} -eq 5 ]; then
-      TERM_FILTER="(!(term=W${YEAR}))(!(term=W${YEAR}))"
+      TERM_FILTER="(!(term=W${YEAR}))(!(term=S${YEAR}))"
    else
       TERM_FILTER="(!(term=S${YEAR}))"
    fi
@@ -53,8 +54,8 @@ for uid in $(cat ${EXPIRED_USERS}); do
    if [ -d /users/${uid}/www ] && [[ ! ${WHITELIST} =~ ${uid} ]]; then
       echo "<Directory /users/${uid}>"
       echo "    AllowOverride None"
-      echo "    RewriteEngine On"
-      echo "    RewriteRule . ${DISABLED_PAGE} [L]"
+      echo "    Redirect 503 /"
+      echo "    ErrorDocument 503 /~sysadmin/expired/index.html"
       echo "</Directory>"
       echo ""
    fi