#! /bin/sh
# file://~/bin/mount-disk.sh # @author: www.RzR.online.FR
#------------------------------------------------------------------------------
# @author:  www.Philippe.COVAL.online.FR - Rev:$Author$
# Copyright and Licence : GPL : http://RzR.online.fr/license.htm
#------------------------------------------------------------------------------
VERSION=0.0.20061127
LDEV=${LDEV:=/dev/hda}

if [ ! -z $1 ] 
then
LDEV=$*
else
dmesg  | grep -e '^.d.: ' | cut -d' ' -f 1 | sort | uniq | sed -e 's|\(.*\):|/dev/\1|g'
fi

for DEV in $LDEV 
do 
 L=`fdisk -l ${DEV} | grep "^/dev/" | sed -e 's|/dev/\(\w*\) .*|\1|g' | xargs -n1 echo  ` ; \
 for  D in $L ; do  echo "== $D ==" ; mkdir -p /mnt/$D ;  sudo mount /dev/$D /mnt/$D ;  ls -l /mnt/$D ; done; \ 
done

for DEV in $LDEV
do
 for  D in $L ; do echo "/dev/$D /mnt/$D auto defaults 0 0" ; done ; \
done


df
#EOF