1
0
mirror of https://github.com/rancher/os.git synced 2025-08-28 19:21:42 +00:00
os/images/02-udev/udev.sh
2016-07-27 23:25:08 -07:00

34 lines
566 B
Bash
Executable File

#!/bin/bash
if [ "$DAEMON" = true ]; then
exec udevd
fi
udevd --daemon
udevadm trigger --action=add
udevadm settle
dev=$(ros config get rancher.state.dev)
wait=$(ros config get rancher.state.wait)
if [ "$BOOTSTRAP" != true ] || [ "$dev" == "" ] || [ "$wait" != "true" ]; then
exit
fi
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