test.init 545 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. #PKG adk-test-tools
  3. #INIT 90
  4. . /etc/rc.conf
  5. case $1 in
  6. autostop) ;;
  7. autostart)
  8. test x"${test:-NO}" = x"NO" && exit 0
  9. test x"$test" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  10. exec sh $0 start
  11. ;;
  12. start)
  13. echo "Setting time via network ..."
  14. rdate -nv pool.ntp.org
  15. grep shell /proc/cmdline > /dev/null 2&>1
  16. if [ $? -eq 0 ];then
  17. exit 0
  18. fi
  19. echo "Starting test script ..."
  20. if [ -x /run.sh ];then
  21. /run.sh
  22. quit
  23. else
  24. echo "no run.sh found"
  25. quit
  26. fi
  27. ;;
  28. *)
  29. echo "Usage: $0 {start}"
  30. exit 1
  31. ;;
  32. esac
  33. exit $?