Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 2nd, 2011  |  syntax: None  |  size: 0.89 KB  |  views: 88  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pkgname=lightdm
  2.  
  3. post_install() {
  4.   getent group lightdm >/dev/null 2>&1 || groupadd -g 121 lightdm
  5.   getent passwd lightdm > /dev/null 2>&1 || usr/sbin/useradd -c 'LightDM Display Manager' -u 121 -g lightdm -d /var/lib/lightdm -s /sbin/nologin lightdm
  6.   passwd -l lightdm > /dev/null
  7.   chown -R lightdm:lightdm /var/lib/lightdm > /dev/null
  8.  
  9.   gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  10.   gconfpkg --install ${pkgname}
  11.   glib-compile-schemas usr/share/glib-2.0/schemas
  12. }
  13.  
  14. pre_remove() {
  15.   if [ -f usr/share/gconf/schemas/${pkgname}.schemas ]; then
  16.     gconfpkg --uninstall ${pkgname}
  17.   fi
  18. }
  19.  
  20. post_upgrade() {
  21.   post_install
  22. }
  23.  
  24. post_remove() {
  25.   glib-compile-schemas usr/share/glib-2.0/schemas
  26.   gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  27.   getent passwd lightdm >/dev/null 2>&1 && userdel lightdm
  28.   getent group lightdm >/dev/null 2>&1 && groupdel lightdm
  29. }
  30.