1
0
mirror of https://github.com/rancher/os.git synced 2025-08-29 11:34:42 +00:00
os/images/02-udev/udev.sh

34 lines
566 B
Bash
Raw Normal View History

2016-05-06 17:12:09 +00:00
#!/bin/bash
if [ "$DAEMON" = true ]; then
exec udevd
fi
udevd --daemon
udevadm trigger --action=add
udevadm settle
2016-07-28 06:25:08 +00:00
dev=$(ros config get rancher.state.dev)
wait=$(ros config get rancher.state.wait)
if [ "$BOOTSTRAP" != true ] || [ "$dev" == "" ] || [ "$wait" != "true" ]; then
exit
2016-05-06 17:12:09 +00:00
fi
2016-07-28 06:25:08 +00:00
for i in `seq 1 30`; do
drive=$(ros dev $dev)
if [ "$drive" != "" ]; then
break
fi
sleep 1
done
drive=$(ros dev $dev)
if [ "$drive" = "" ]; then
exit
fi
for i in `seq 1 30`; do
if [ -e $drive ]; then
break
fi
sleep 1
done