mirror of
https://github.com/moparisthebest/arch-ppa
synced 2024-11-11 19:45:01 -05:00
29 lines
920 B
Plaintext
29 lines
920 B
Plaintext
|
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
|
||
|
}
|
||
|
|