#!/bin/sh
# mounts all partitions, 
# while-Schleife als "for(;;)"-Ersatz
# 170902

# hier einfügen, welche Harddisk-Partitionen gemountet werden sollen
# z.B. sda sdb ...
# for HD in hda sda

mnt-dir=media
for HD in hda hdb
do
   i=4   # Anzahl der Partitionen auf der HD
   while ( test $i -gt 0 )
   do
      if ( test ! -e /$mnt-dir/$HD$i ); then 
         echo "/$mnt-dir/$HD$i does not exist, generating it" 
	 mkdir /$mnt-dir/$HD$i
      fi
      mount -v /dev/$HD$i /$mnt-dir/$HD$i
      i=$[$i-1]
   done
done

