summarylogtreecommitdiffstats
path: root/sabnzbd.install
blob: ae81376f6a376d5a7139d4d643df3f3587111ef8 (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
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
    mv /opt/sabnzbd/sabnzbd.ini /var/lib/sabnzbd/
    echo "Moved sabnzbd.ini from /opt/sabnzbd to /var/lib/sabnzbd."
  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
    mv /opt/sabnzbd/admin /var/lib/sabnzbd/
    echo "Moved admin folder from /opt/sabnzbd to /var/lib/sabnzbd/."
  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
    mv /opt/sabnzbd/logs /var/lib/sabnzbd/
    echo "Moved logs folder from /opt/sabnzbd to /var/lib/sabnzbd/."
  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
}