summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Webster2020-08-08 23:17:11 -0700
committerDonald Webster2020-08-08 23:17:11 -0700
commit5537cad7fbcd7a0917c2e045af24d21b9827137d (patch)
tree0e14b292b46c639f57dd0f007fb3dc6982519270
parent8bcdd5cc92f482c3ccc7cdebb3d1442a4022274f (diff)
downloadaur-5537cad7fbcd7a0917c2e045af24d21b9827137d.tar.gz
Gate the whole thing around /opt/sabnzbd existing.
-rw-r--r--sabnzbd.install40
1 files changed, 20 insertions, 20 deletions
diff --git a/sabnzbd.install b/sabnzbd.install
index 096af080447..857a1842fec 100644
--- a/sabnzbd.install
+++ b/sabnzbd.install
@@ -1,27 +1,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
+ if [[ -d /opt/sabnzbd ]]; then
+ # 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 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 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
+ # Suggest removing /opt/sabnzbd.
echo "Remove /opt/sabnzbd if everything is working correctly from /var/lib/sabnzbd now."
fi
}