#!/bin/sh math () { eval echo "\$(($*))" } filesystem="wwwcluster:ocfs2" minor=0 mountpoint="/mnt/iscsi" if [ -d $mountpoint ]; then mkdir -p $mountpoint fi until [ $minor -gt 255 ]; do device=/dev/dm-$minor if [ -r $device ]; then if vol_id $device | \ grep -q "ID_FS_LABEL=$filesystem"; then mount $device $mountpoint -t ocfs2 -o noatime,nodiratime,localalloc=16,commit=10 fi fi minor=`math $minor + 1` done invoke-rc.d apache2 stop invoke-rc.d apache2 start exit 0