#######################################################################################
#                                                                                     # 
#                        yourfritz customization framework                            # 
#                                                                                     # 
#######################################################################################
#                                                                                     #
# Copyright (C) 2014-2015 P. Haemmerlein / framework@yourfritz.de                     #
#                                                                                     #
# This program is free software; you can redistribute it and/or                       #
# modify it under the terms of the GNU General Public License                         #
# as published by the Free Software Foundation; either version 2                      #
# of the License, or (at your option) any later version.                              #
#                                                                                     #
# This program is distributed in the hope that it will be useful,                     #
# but WITHOUT ANY WARRANTY; without even the implied warranty of                      #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                       #
# GNU General Public License under                                                    #
#                                                                                     #
# http://www.gnu.org/licenses/gpl-2.0.html                                            #
#                                                                                     #
# for more details.                                                                   #
#                                                                                     #
#######################################################################################
#                                                                                     #
# "FRITZ!Box" and "FRITZ!" are registered word marks and "AVM" is a registered        #
# word and figurative mark of:                                                        #
# AVM Computersysteme Vertriebs GmbH, 10559, Berlin, DE.                              #
#                                                                                     #
#######################################################################################
#                                                                                     #
# mount fstab entries below our base directory                                        #
#                                                                                     #
#######################################################################################
yourfritz_mount_fstab_entries()
{
	local fstab="$1" srcdir mountpoint fstype options rc=0
	if [ -f "$fstab" -a -r "$fstab" ]; then
		sed -e '/^#/d' "$fstab" |
		while read srcdir mountpoint fstype options; do
			if [ x"$options" != x"defaults" ]; then
				options="-o $options "
			else
				unset options
			fi
			eval srcdir="$srcdir"
			mount -t $fstype "$options"$srcdir $YOURFRITZ_BASEDIR$mountpoint
			rc=$?
			if [ $rc -eq 0 ]; then
				yourfritz_log_message 119 "$fstype" "$YOURFRITZ_BASEDIR$mountpoint" "$srcdir"
			else
				yourfritz_log_message 120 $rc "$fstype" "$YOURFRITZ_BASEDIR$mountpoint" "$srcdir"
				rc=120
				[ x"$fstype" == x"tmpfs" ] && return $rc
			fi
		done
	fi
	return $rc
}
#######################################################################################
#                                                                                     # 
#                        yourfritz customization framework                            # 
#                                                                                     # 
#######################################################################################
