blob: 096af080447da274e5ab3f1b2697b18023583f79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
post_upgrade() {
# Test for the *old* config file and *lack* of new config file, move if needed.
if [[ -f /opt/sabnzbd/sabnzbd.ini && ! -f /var/lib/sabnzbd/sabnzbd.ini ]]; then
cp -a /opt/sabnzbd/sabnzbd.ini /var/lib/sabnzbd/
mv /opt/sabnzbd/sabnzbd.ini /opt/sabnzbd/sabnzbd.ini.saved
echo "Copied sabnzbd.ini from /opt/sabnzbd to /var/lib/sabnzbd and renamed /opt/sabnzbd/sabnzbd.ini to /opt/sabnzbd/sabnzbd.ini.saved."
fi
# Test for old admin folder and *lack* of new admin folder, move if needed.
if [[ -d /opt/sabnzbd/admin && ! -d /var/lib/sabnzbd/admin ]]; then
cp -a /opt/sabnzbd/admin /var/lib/sabnzbd/
mv /opt/sabnzbd/admin /opt/sabnzbd/admin.saved
echo "Copied admin folder from /opt/sabnzbd to /var/lib/sabnzbd/ and renamed /opt/sabnzbd/admin to /opt/sabnzbd/admin.saved."
fi
# Test for old logs folder and *lack* of new logs folder, move if needed.
if [[ -d /opt/sabnzbd/logs && ! -d /var/lib/sabnzbd/logs ]]; then
cp -a /opt/sabnzbd/logs /var/lib/sabnzbd/
mv /opt/sabnzbd/logs /opt/sabnzbd/logs.saved
echo "Moved logs folder from /opt/sabnzbd to /var/lib/sabnzbd/ and renamed /opt/sabnzbd/logs to /opt/sabnzbd/logs.saved."
fi
# Test for old install location, suggest removal.
if [[ -d /opt/sabnzbd ]]; then
echo "Remove /opt/sabnzbd if everything is working correctly from /var/lib/sabnzbd now."
fi
}
|