|
@@ -13,13 +13,15 @@ cd "$tmp" || exit -1
|
|
|
|
|
|
|
|
echo -n "Checking current boot device..."
|
|
echo -n "Checking current boot device..."
|
|
|
if [[ -z $1 ]] ; then
|
|
if [[ -z $1 ]] ; then
|
|
|
- usb=$(rmformat | grep Logical | awk '{print $4}' | sed 's/rdsk/dsk/;s/p0$/p1/')
|
|
|
|
|
- echo -n " detected $usb"
|
|
|
|
|
- usb_count=(${usb})
|
|
|
|
|
- if [ ${#usb_count[@]} -gt 1 ]; then
|
|
|
|
|
- echo " Warning: more than one removable device detected."
|
|
|
|
|
|
|
+ removables=($(disklist -r))
|
|
|
|
|
+ echo -n " detected ${removables[@]}"
|
|
|
|
|
+ if [[ ${#removables[@]} -gt 1 ]]; then
|
|
|
|
|
+ echo
|
|
|
|
|
+ echo "Error: more than one removable device detected."
|
|
|
|
|
+ echo "Specify correct device on the command line."
|
|
|
exit -1
|
|
exit -1
|
|
|
fi
|
|
fi
|
|
|
|
|
+ usb="/dev/dsk/${removables[0]}p1"
|
|
|
else
|
|
else
|
|
|
usb="$1"
|
|
usb="$1"
|
|
|
echo -n " using $usb"
|
|
echo -n " using $usb"
|