2012-08-28 15:44:46 +00:00
|
|
|
## arg 1: the new package version
|
|
|
|
post_install() {
|
|
|
|
if grep -q "^sickbeard" /etc/group &> /dev/null ; then
|
|
|
|
groupmod -n sickbeard sickbeard &> /dev/null
|
|
|
|
else
|
|
|
|
groupadd -r sickbeard &> /dev/null
|
|
|
|
fi
|
|
|
|
if grep -q "^sickbeard:" /etc/passwd 2> /dev/null ; then
|
|
|
|
usermod -s /bin/false -c "Sickbeard user" -d /opt/sickbeard -g sickbeard sickbeard &> /dev/null
|
|
|
|
else
|
|
|
|
useradd -s /bin/false -c "Sickbeard user" -d /opt/sickbeard -g sickbeard -r sickbeard &> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
groupadd sickbeard &> /dev/null
|
|
|
|
useradd -g sickbeard -d /opt/sickbeard -s /bin/false sickbeard &> /dev/null
|
2013-01-12 00:24:04 +00:00
|
|
|
chgrp -R sickbeard /opt/sickbeard
|
2012-08-28 15:44:46 +00:00
|
|
|
# sed -i 's/^if isinstance(sys.version_info, tuple):$/if isinstance(sys.version_info[:], tuple):/g' "/usr/lib/python2.7/site-packages/Cheetah/Template.py"
|
|
|
|
|
|
|
|
# Create a directory in /run if it does not exist
|
|
|
|
if [ ! -d /run/sickbeard ]; then
|
|
|
|
mkdir /run/sickbeard
|
|
|
|
chown sickbeard:sickbeard /run/sickbeard
|
|
|
|
chmod 775 /run/sickbeard
|
|
|
|
fi
|
2013-01-12 00:24:04 +00:00
|
|
|
|
2012-08-28 15:44:46 +00:00
|
|
|
}
|
|
|
|
## arg 1: the new package version
|
|
|
|
## arg 2: the old package version
|
|
|
|
post_upgrade() {
|
2013-01-12 00:24:04 +00:00
|
|
|
chgrp -R sickbeard /opt/sickbeard
|
2012-08-28 15:44:46 +00:00
|
|
|
sed -i 's/^if isinstance(sys.version_info, tuple):$/if isinstance(sys.version_info[:], tuple):/g' "/usr/lib/python2.7/site-packages/Cheetah/Template.py"
|
|
|
|
|
|
|
|
# Create a directory in /run if it does not exist
|
|
|
|
if [ ! -d /run/sickbeard ]; then
|
|
|
|
mkdir /run/sickbeard
|
|
|
|
chown sickbeard:sickbeard /run/sickbeard
|
|
|
|
chmod 775 /run/sickbeard
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
## arg 1: the old package version
|
|
|
|
pre_remove() {
|
|
|
|
userdel sickbeard &> /dev/null
|
|
|
|
}
|
|
|
|
|
|
|
|
post_remove() {
|
|
|
|
echo 'Some files have not been removed because they are created by sickbeard itself, e.g. the show database.'
|
|
|
|
}
|
|
|
|
|