source: MondoRescue/branches/2.2.10/mindi/rootfs/sbin/start-usb@ 2329

Last change on this file since 2329 was 2329, checked in by Bruno Cornec, 15 years ago

r3340@localhost: bruno | 2009-08-12 00:17:29 +0200
Improve portability by defining all cmdline usage in 1 include (/tmp for FreeBSD and /proc fior LInux). Also doing tht for scripts.

  • Property svn:executable set to *
File size: 717 bytes
Line 
1#!/bin/sh
2#
3# $Id$
4#
5# This script sets up the USB media
6#
7
8# Get info from config file
9MRUSBDEV=`grep usb-dev /tmp/mondo-restore.cfg 2> /dev/null | cut -d' ' -f2-`
10
11# info from cmdline are predominent
12for i in `cat $CMDLINE` ; do
13 echo $i | grep -qi usb= && MRUSBDEV=`echo $i | cut -d= -f2`
14done
15
16if [ $MRUSBDEV = "" ]; then
17 # No usb configuration neither stored during archive
18 # nor on cmdline so no usb wanted => exiting
19 exit 0
20fi
21
22export MRUSBDEV
23
24echo -en "Mounting USB device (${MRUSBDEV}1) on /mnt/cdrom..."
25/sbin/modprobe usb-storage
26for i in 1 2 3 4 5 6 7 8 9 10 ; do
27 sleep 1
28 echo -en "."
29done
30mount -t vfat ${MRUSBDEV}1 /mnt/cdrom && LogIt "USB device (${MRUSBDEV}1) mounted on /mnt/cdrom"
31echo "."
Note: See TracBrowser for help on using the repository browser.