blob: fd82ca181e1e0c850e63cb6cf2d9e99e18c31307 (
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
25
26
27
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
}
|