udev.sh 566 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. if [ "$DAEMON" = true ]; then
  3. exec udevd
  4. fi
  5. udevd --daemon
  6. udevadm trigger --action=add
  7. udevadm settle
  8. dev=$(ros config get rancher.state.dev)
  9. wait=$(ros config get rancher.state.wait)
  10. if [ "$BOOTSTRAP" != true ] || [ "$dev" == "" ] || [ "$wait" != "true" ]; then
  11. exit
  12. fi
  13. for i in `seq 1 30`; do
  14. drive=$(ros dev $dev)
  15. if [ "$drive" != "" ]; then
  16. break
  17. fi
  18. sleep 1
  19. done
  20. drive=$(ros dev $dev)
  21. if [ "$drive" = "" ]; then
  22. exit
  23. fi
  24. for i in `seq 1 30`; do
  25. if [ -e $drive ]; then
  26. break
  27. fi
  28. sleep 1
  29. done