PKGBUILDs/aur/sickbeard-git/sickbeard.install
Kevin Mihelich 00452949e1 aur updates
2013-02-02 00:03:21 +00:00

50 lines
1.6 KiB
Text

## 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
chgrp -R sickbeard /opt/sickbeard
# 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 new package version
## arg 2: the old package version
post_upgrade() {
chgrp -R sickbeard /opt/sickbeard
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.'
}