scanlogd.postinst 886 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. . $IPKG_INSTROOT/etc/functions.sh
  3. add_rcconf scanlogd scanlogd NO
  4. name=scanlogd
  5. id=53
  6. # do not change below
  7. # check if we are on real system
  8. if [ -z "${IPKG_INSTROOT}" ]; then
  9. # create copies of passwd and group, if we use squashfs
  10. rootfs=`mount |awk '/root/ { print $5 }'`
  11. if [ "$rootfs" = "squashfs" ]; then
  12. if [ -h /etc/group ]; then
  13. rm /etc/group
  14. cp /rom/etc/group /etc/group
  15. fi
  16. if [ -h /etc/passwd ]; then
  17. rm /etc/passwd
  18. cp /rom/etc/passwd /etc/passwd
  19. fi
  20. fi
  21. fi
  22. echo ""
  23. if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/group)" ]; then
  24. echo "adding group $name to /etc/group"
  25. echo "${name}:x:${id}:" >> ${IPKG_INSTROOT}/etc/group
  26. fi
  27. if [ -z "$(grep ^\\${name}: ${IPKG_INSTROOT}/etc/passwd)" ]; then
  28. echo "adding user $name to /etc/passwd"
  29. echo "${name}:x:${id}:${id}:${name}:/tmp/.${name}:/bin/false" >> ${IPKG_INSTROOT}/etc/passwd
  30. fi