Fix bug where 1-month grace period was ignored
authorZachary Seguin <ztseguin@csclub.uwaterloo.ca>
Thu, 14 Jan 2016 18:07:14 +0000 (13:07 -0500)
committerZachary Seguin <ztseguin@csclub.uwaterloo.ca>
Thu, 14 Jan 2016 18:07:14 +0000 (13:07 -0500)
disable-webspace

index 9e65341..1a058c3 100755 (executable)
@@ -21,19 +21,19 @@ TERM_START_MONTH=$(($MONTH - (($MONTH - 1) % 4)))
 
 # NOTE: This is configured to give 1 months grace period
 if [ ${TERM_START_MONTH} -eq 1 ]; then
 
 # NOTE: This is configured to give 1 months grace period
 if [ ${TERM_START_MONTH} -eq 1 ]; then
-   if [ ${MONTH} = 1 ]; then
+   if [ ${MONTH} -eq 1 ]; then
       TERM_FILTER="(!(term=F$((${YEAR} - 1))))(!(term=W${YEAR}))"
    else
       TERM_FILTER="(!(term=W${YEAR}))"
    fi
 elif [ ${TERM_START_MONTH} -eq 5 ]; then
       TERM_FILTER="(!(term=F$((${YEAR} - 1))))(!(term=W${YEAR}))"
    else
       TERM_FILTER="(!(term=W${YEAR}))"
    fi
 elif [ ${TERM_START_MONTH} -eq 5 ]; then
-   if [ ${MONTH} = 5 ]; then
+   if [ ${MONTH} -eq 5 ]; then
       TERM_FILTER="(!(term=W${YEAR}))(!(term=W${YEAR}))"
    else
       TERM_FILTER="(!(term=S${YEAR}))"
    fi
 elif [ ${TERM_START_MONTH} -eq 9 ]; then
       TERM_FILTER="(!(term=W${YEAR}))(!(term=W${YEAR}))"
    else
       TERM_FILTER="(!(term=S${YEAR}))"
    fi
 elif [ ${TERM_START_MONTH} -eq 9 ]; then
-   if [ ${MONTH} = 9 ]; then
+   if [ ${MONTH} -eq 9 ]; then
       TERM_FILTER="(!(term=S${YEAR}))(!(term=F${YEAR}))"
    else
       TERM_FILTER="(!(term=F${YEAR}))"
       TERM_FILTER="(!(term=S${YEAR}))(!(term=F${YEAR}))"
    else
       TERM_FILTER="(!(term=F${YEAR}))"