tor.postinst 553 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. . $IPKG_INSTROOT/etc/functions.sh
  3. add_rcconf tor tor NO
  4. # do not change below
  5. # check if we are on real system
  6. if [[ -z $IPKG_INSTROOT ]]; then
  7. # create copies of passwd and group, if we use squashfs
  8. rootfs=`mount |awk '/root/ { print $5 }'`
  9. if [ "$rootfs" = "squashfs" ]; then
  10. if [ -h /etc/group ]; then
  11. rm /etc/group
  12. cp /rom/etc/group /etc/group
  13. fi
  14. if [ -h /etc/passwd ]; then
  15. rm /etc/passwd
  16. cp /rom/etc/passwd /etc/passwd
  17. fi
  18. fi
  19. fi
  20. gid=$(get_next_gid)
  21. add_group tor $gid
  22. add_user tor $(get_next_uid) $gid /tmp/.tor