Merge branch 'mika/efi'
[grml-live.git] / buildd / cleanup.sh
index d0e6fe7..93457ab 100755 (executable)
@@ -22,9 +22,8 @@ if [ -z "$MIRROR_DIRECTORY" ] ; then
   exit 1
 fi
 
-# mail address where reports should be sent to
-if [ -z "$STORAGE_ADMIN" ] ; then
-  echo "Error: \$STORAGE_ADMIN is not set. Exiting." >&2
+if [ -z "$FLAVOURS" ] ; then
+  echo "Error: \$FLAVOURS is not set. Exiting." >&2
   exit 2
 fi
 
@@ -39,9 +38,7 @@ fi
 DAYS=3
 
 REMOVE_ME=""
-for flavour in grml-medium_squeeze   grml-medium_wheezy   grml-medium_sid   grml-small_squeeze   grml-small_wheezy  grml-small_sid \
-               grml64-medium_squeeze grml64-medium_wheezy grml64-medium_sid grml64-small_squeeze grml64-small_wheezy grml64-small_sid \
-               grml64_squeeze grml64_wheezy grml64_sid grml_squeeze grml_wheezy grml_sid ; do
+for flavour in $FLAVOURS; do
   FILE_COUNT=$(ls -1 $flavour/$flavour*.iso | wc -l)
   if [ "$FILE_COUNT" -gt "$DAYS" ] ; then
      FILES=$(ls -1 $flavour/$flavour*.iso | tail -"$DAYS")
@@ -63,7 +60,7 @@ done
 
 # inform on successful removal:
 if [ "$(echo "$REMOVE_ME" | tr -d ' ' )" != "" ] ; then
-   echo "deleted files $REMOVE_ME" | mail -s "daily-builds cleanup script" "$STORAGE_ADMIN"
+   echo "Removed previous files $REMOVE_ME" | logger -t grml-buildd
 fi
 
 ## END OF FILE #################################################################