]> git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/system/waitdrives
unbound: Drop certificates for local control connection
[ipfire-2.x.git] / src / initscripts / system / waitdrives
1 #!/bin/sh
2 ########################################################################
3 # Begin $rc_base/init.d/waitdrives
4 #
5 # Description : Wait for drives before fscheck/mount
6 #
7 # Authors : Arne Fitzenreiter - arne_f@ipfire.org
8 #
9 # Version : 00.00
10 #
11 # Notes :
12 #
13 ########################################################################
14
15 . /etc/sysconfig/rc
16 . ${rc_functions}
17
18 check_drives () {
19 drives_ready="1";
20 for drive in $drives; do
21 if [ `blkid | grep $drive | wc -l` == 0 ]; then
22 drives_ready="0";
23 fi
24 done
25 }
26
27 case "${1}" in
28 start)
29 drives=`grep "^UUID=" /etc/fstab | cut -f1 | cut -d" " -f1 | cut -d"=" -f2`;
30
31 check_drives;
32 if [ "$drives_ready" == "0" ]; then
33 boot_mesg -n "Wait for devices used in fstab "
34 for (( i=1; i<30; i++)) do
35 check_drives;
36 if [ "$drives_ready" == "1" ]; then
37 break;
38 fi
39 boot_mesg -n "."
40 sleep 1
41 done
42 fi
43 exit 0;
44 ;;
45 *)
46 echo "Usage: ${0} {start}"
47 exit 1
48 ;;
49 esac
50
51 # End $rc_base/init.d/waitdrives