S83app 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. mount -o remount rw /
  3. sleep 1
  4. echo "==================== Start App ===================="
  5. /usr/sbin/telnetd
  6. eval $( /usr/bin/awk '/\/dev\/root/ {printf("flashfs=%s", $3)}' /proc/mounts)
  7. eval $( /usr/bin/awk '/nfs/ {printf("fstype=%s", $3)}' /proc/mounts)
  8. eval $( /usr/bin/awk '/system/{$a=substr($0,4,1);printf("system_name=/dev/mtdblock%d",$a)}' /proc/mtd)
  9. eval $( /usr/bin/awk '/dav1/{$a=substr($0,4,1);printf("para1_name=/dev/mtdblock%d", $a)}' /proc/mtd)
  10. eval $( /usr/bin/awk '/dav2/{$a=substr($0,4,1);printf("para2_name=/dev/mtdblock%d",$a)}' /proc/mtd)
  11. echo "partition information:"
  12. echo "current filesystem on:$flashfs$fstype"
  13. echo system_name=$system_name
  14. echo para1_name=$para1_name
  15. echo para2_name=$para2_name
  16. if [ "$flashfs" == "ext2" ] ; then
  17. echo "==================== flash filesystem ===================="
  18. if [ "$system_name" != "" ] ; then
  19. /bin/mount -t yaffs2 "$system_name" /boot/
  20. if [ -e /boot/app.tar.gz ] ; then
  21. /bin/tar -zxf /boot/app.tar.gz -C /
  22. echo "mount yaffs2 filesystem done."
  23. else
  24. echo "no application package!!!."
  25. fi
  26. fi
  27. if [ "$para1_name" != "" ] ; then
  28. /bin/mount -t yaffs2 "$para1_name" /dav1/
  29. fi
  30. if [ "$para2_name" != "" ] ; then
  31. /bin/mount -t yaffs2 "$para2_name" /dav2/
  32. fi
  33. elif [ "$fstype" == "nfs" ] ; then
  34. echo "==================== network filesystem ===================="
  35. else
  36. echo "==================== unknown filesystem ===================="
  37. fi
  38. sh /home/startapp.sh