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
|
|
|
|
getent passwd xbmc > /dev/null || 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
|
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
|
|
|
|
groupmod -g 420 xbmc
|
|
|
|
fi
|
|
|
|
if ! id -u xbmc | grep 420 > /dev/null 2>&1; then
|
|
|
|
usermod -u 420 xbmc
|
|
|
|
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
|
|
|
}
|