package.py 515 B

1234567891011121314151617181920212223
  1. #!/usr/bin/python
  2. import os, re
  3. OUR_ID = 101
  4. OUR_NAME = "dbus"
  5. OUR_DESC = "dbus"
  6. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  7. try:
  8. os.system ("groupadd -g %d %s" % (OUR_ID, OUR_NAME))
  9. os.system ("useradd -m -d /run/dbus -r -s /bin/false -u %d -g %d %s -c \"%s\"" % (OUR_ID, OUR_ID, OUR_NAME, OUR_DESC))
  10. except:
  11. pass
  12. def postRemove():
  13. try:
  14. os.system ("userdel %s" % OUR_NAME)
  15. os.system ("groupdel %s" % OUR_NAME)
  16. except:
  17. pass