change "while read x" to cope with EOF without newline
[dracut.git] / test / TEST-40-NBD / client-init.sh
blob2b42e21b5a3a75ffe5bbcba636160d787453fc61
1 #!/bin/sh
2 >/dev/watchdog
3 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
4 exec >/dev/console 2>&1
5 while read dev fs fstype opts rest || [ -n "$dev" ]; do
6 [ "$dev" = "rootfs" ] && continue
7 [ "$fs" != "/" ] && continue
8 echo "nbd-OK $fstype $opts" >/dev/sda
9 echo "nbd-OK $fstype $opts"
10 break
11 done < /proc/mounts
12 export TERM=linux
13 export PS1='nbdclient-test:\w\$ '
14 stty sane
15 echo "made it to the rootfs! Powering down."
16 #sh -i
17 >/dev/watchdog
18 mount -n -o remount,ro / &> /dev/null
19 >/dev/watchdog
20 poweroff -f