#!/bin/sh

if [ -e "/etc/config/rtorrent-prev" ]; then
  mv /etc/config/rtorrent-prev /etc/config/rtorrent
else
  touch /etc/config/rtorrent
fi

if ! uci get rtorrent.logging &>/dev/null; then
  uci set rtorrent.logging=rss \
  && uci commit rtorrent
fi

rm -fr /tmp/luci-indexcache* /tmp/luci-modulecache

exit 0
