First complete

This commit is contained in:
moparisthebest
2016-11-05 02:18:08 -04:00
parent 0887a41178
commit fd2414b131
82 changed files with 1689 additions and 6 deletions
+28
View File
@@ -0,0 +1,28 @@
post_install() {
if grep -q "^sonarr" /etc/group &> /dev/null ; then
groupmod -n sonarr sonarr &> /dev/null
else
groupadd -r sonarr &> /dev/null
fi
if grep -q "^sonarr:" /etc/passwd 2> /dev/null ; then
usermod -s /bin/false -c "Sonarr daemon" -d /var/lib/sonarr -g sonarr sonarr &> /dev/null
else
useradd -s /bin/false -c "Sonarr daemon user" -d /var/lib/sonarr -g sonarr -r sonarr &> /dev/null
fi
mkdir -p /var/lib/sonarr
if [[ ! -f /var/lib/sonarr/config.xml ]]
then
if [[ -f /var/lib/nzbdrone/config.xml ]]
then
echo "A previous installation of nzbdrone has been detected. Copying previous configuration to Sonarr"
cp -r /var/lib/nzbdrone/* /var/lib/sonarr
fi
chown -R sonarr: /var/lib/sonarr
fi
}
post_upgrade() {
post_install $1
}