PKGBUILDs/community/xbmc/xbmc.install

37 lines
1.2 KiB
Text
Raw Normal View History

2012-06-08 23:57:07 +00:00
post_install() {
2014-05-26 13:10:50 +00:00
update_icons
getent group xbmc > /dev/null || groupadd -g 420 xbmc
2014-06-03 00:25:59 +00:00
if ! getent passwd xbmc > /dev/null; then
useradd -c 'XBMC user' -u 420 -g xbmc -G audio,video,network,optical -d /var/lib/xbmc -s /sbin/nologin xbmc
passwd -l xbmc > /dev/null
fi
2012-06-08 23:57:07 +00:00
}
post_upgrade() {
post_install $1
2014-05-26 13:10:50 +00:00
if ! getent group xbmc | cut -d: -f3 | grep 420 > /dev/null 2>&1; then
2014-06-10 19:45:47 +00:00
groupmod -g 420 xbmc > /dev/null 2>&1
2014-05-26 13:10:50 +00:00
fi
if ! id -u xbmc | grep 420 > /dev/null 2>&1; then
2014-06-10 19:45:47 +00:00
usermod -u 420 xbmc > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "Changing uid of user xbmc failed"
echo "It is recommended that the uid is changed."
echo "Stop all processes running under the xbmc user and reinstall xbmc"
echo "or change the uid manually. (usermod -u 420 xbmc)"
fi
2014-05-26 13:10:50 +00:00
chown -R xbmc:xbmc /var/lib/xbmc
fi
2012-06-08 23:57:07 +00:00
}
post_remove() {
2014-05-26 13:10:50 +00:00
update_icons
getent passwd xbmc > /dev/null 2>&1 && userdel xbmc
getent group xbmc > /dev/null 2>&1 && groupdel xbmc
}
update_icons() {
type -p gtk-update-icon-cache > /dev/null 2>&1 && usr/bin/gtk-update-icon-cache -qtf usr/share/icons/hicolor
type -p update-desktop-database > /dev/null 2>&1 && usr/bin/update-desktop-database -q usr/share/applications
2012-06-08 23:57:07 +00:00
}