-NU=ntp
-U=`grep "^$NU:" ${IPKG_INSTROOT}/etc/passwd 2>/dev/null | cut -d: -f3`
-if [ .$U = . ]; then
- U=`cut -d: -f3 ${IPKG_INSTROOT}/etc/passwd 2>/dev/null | sort -n | tail -1`
- [ .$U = . ] && U=49
- U=`expr $U + 1`
- [ $U -lt 50 ] && U=50
- G=`grep "^$NU:" ${IPKG_INSTROOT}/etc/group 2>/dev/null | cut -d: -f3`
- if [ .$G = . ]; then
- G=`cut -d: -f3 ${IPKG_INSTROOT}/etc/group 2>/dev/null | sort -n | tail -1`
- [ .$G = . ] && G=49
- G=`expr $G + 1`
- [ $G -lt 50 ] && G=50
+name=ntp
+id=50
+
+# do not change below
+# check if we are on real system
+if [ -z "${IPKG_INSTROOT}" ]; then
+ # create copies of passwd and group, if we use squashfs
+ rootfs=`mount |awk '/root/ { print $5 }'`
+ if [ "$rootfs" = "squashfs" ]; then
+ if [ -h /etc/group ]; then
+ rm /etc/group
+ cp /rom/etc/group /etc/group
+ fi
+ if [ -h /etc/passwd ]; then
+ rm /etc/passwd
+ cp /rom/etc/passwd /etc/passwd
+ fi