This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/rules/filesystem/fs/etc/rc.d/storage

42 lines
852 B
Plaintext
Raw Normal View History

2013-07-13 17:19:22 +01:00
start()
{
for unit in $cfg_storage; do
label="$(echo $unit | cut -f1 -d:)"
fstype="$(echo $unit | cut -f2 -d:)"
point="$(echo $unit | cut -f3 -d:)"
if ! [ -d "$point" ]; then
mkdir -p "$point"
fi
n=0; while [ $n -lt 120 ]; do
2013-07-13 17:19:22 +01:00
args=''
if [ $fstype = 'ext3' ]; then
args='-o noatime,data=ordered'
fi
mount -t $fstype $args LABEL="$label" "$point"
if [ $? -eq 0 ]; then
break;
fi
sleep 1
let n++
done
done
}
stop()
{
units=''
for unit in $cfg_storage; do
units="$unit $units"
done
for unit in $units; do
point="$(echo $unit | cut -f3 -d:)"
echo "* Unmounting $point..."
umount "$point"
done
}