2014-06-13 19:05:10 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
f=/mod/etc/sweeper.conf
|
2014-06-13 19:09:47 +00:00
|
|
|
if [ ! -f $f ]; then
|
|
|
|
if [ -f $f~ ]; then
|
|
|
|
cp $f~ $f
|
|
|
|
elif [ -f "$f-opkg.backup" ]; then
|
|
|
|
cp "$f-opkg.backup" $f
|
|
|
|
fi
|
|
|
|
fi
|
2014-06-13 19:05:10 +00:00
|
|
|
|
2014-06-29 21:53:27 +00:00
|
|
|
[ -f /mod/.swschema ] && schema=`cat /mod/.swschema` || schema=1
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2014-06-13 19:05:10 +00:00
|
|
|
exit 0
|
|
|
|
|