#!/bin/sh f=/mod/etc/sweeper.conf if [ -f $f ]; then sum=`/mod/bin/busybox/md5sum $f | awk '{print $1}'` if [ "$sum" = "a22cb1379fb9c58ae549dead9695eebe" ]; then rm -f $f fi fi if [ ! -f $f ]; then if [ -f $f~ ]; then cp $f~ $f elif [ -f "$f-opkg.backup" ]; then cp "$f-opkg.backup" $f fi fi [ -f /mod/.swschema ] && schema=`cat /mod/.swschema` || schema=1 echo "Current Sweeper schema: $schema" case $schema in 1) # Upgrade folder rules echo "Upgrading sweeper rules for folder series." (echo /mod/etc/sweeper.conf; find /media -follow -name .sweeper) \ | while read f; do [ -f "$f" ] || continue echo "Processing $f..." sed -e 's/^folder /& series "" /' -i "$f" done ;; esac echo 2 > /mod/.swschema exit 0