summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Webster2020-08-09 08:35:36 -0700
committerDonald Webster2020-08-09 08:35:36 -0700
commit4f6b9b98d0682b23b9f306c5dc66b1c50a64a79c (patch)
tree25c350654c58b12834e244e6b1b48339aad5ddaa
parent5537cad7fbcd7a0917c2e045af24d21b9827137d (diff)
downloadaur-4f6b9b98d0682b23b9f306c5dc66b1c50a64a79c.tar.gz
Add sabnzbd user home directory changing.
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--sabnzbd.install10
3 files changed, 12 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index bbd499a9606..eca227f75e4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = sabnzbd
pkgdesc = A web-interface based binary newsgrabber with NZB file support
pkgver = 3.0.0
- pkgrel = 3
+ pkgrel = 4
url = http://www.sabnzbd.org
install = sabnzbd.install
arch = any
diff --git a/PKGBUILD b/PKGBUILD
index 7c3b3aa4ea6..8f7ce260268 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname=sabnzbd
pkgver=3.0.0
-pkgrel=3
+pkgrel=4
pkgdesc='A web-interface based binary newsgrabber with NZB file support'
url='http://www.sabnzbd.org'
arch=('any')
diff --git a/sabnzbd.install b/sabnzbd.install
index 857a1842fec..65ca9ac9ed6 100644
--- a/sabnzbd.install
+++ b/sabnzbd.install
@@ -24,4 +24,14 @@ post_upgrade() {
# Suggest removing /opt/sabnzbd.
echo "Remove /opt/sabnzbd if everything is working correctly from /var/lib/sabnzbd now."
fi
+
+ # Check and change the sabnzbd users home directory
+ SABNZBD_HOME="$( getent passwd sabnzbd | awk -F: '{ print $6 }' )"
+ if [[ "${SABNZBD_HOME}" != "/var/lib/sabnzbd" ]]; then
+ if usermod --home /var/lib/sabnzbd sabnzbd; then
+ echo "User sabnzbd home directory changed to /var/lib/sabnzbd."
+ else
+ echo "Error changing sabnzbd home directory, stop sabnzbd and run 'usermod --home /var/lib/sabnzbd sabnzbd' yourself."
+ fi
+ fi
}