source: MondoRescue/branches/3.3/mindi-busybox/examples/mdev.conf.change_blockdev.sh@ 3901

Last change on this file since 3901 was 3621, checked in by Bruno Cornec, 10 years ago

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 623 bytes
RevLine 
[3621]1#!/bin/sh
2
3# Seconds to try to reread partition table
4cnt=60
5
6exec </dev/null
7exec >"/tmp/${0##*/}.$$.out"
8exec 2>&1
9
10(
11echo "Running: $0"
12echo "Env:"
13env | sort
14
15while sleep 1; test $cnt != 0; do
16 echo "Trying to reread partition table on $DEVNAME ($cnt)"
17 : $((cnt--))
18 # If device node doesn't exist, it means the device was removed.
19 # Stop trying.
20 test -e "$DEVNAME" || { echo "$DEVNAME doesn't exist, aborting"; exit 1; }
21 #echo "$DEVNAME exists"
22 if blockdev --rereadpt "$DEVNAME"; then
23 echo "blockdev --rereadpt succeeded"
24 exit 0
25 fi
26 echo "blockdev --rereadpt failed, exit code: $?"
27done
28echo "Timed out"
29) &
Note: See TracBrowser for help on using the repository browser.