--- trunk/magellan-initscripts/etc/rc.d/init.d/functions 2004/12/13 22:52:07 3 +++ trunk/magellan-initscripts/etc/rc.d/init.d/functions 2005/07/03 21:30:58 147 @@ -1,4 +1,6 @@ #!/bin/bash +# $Header: /home/cvsd/magellan-cvs/magellan-src/magellan-initscripts/etc/rc.d/init.d/functions,v 1.4 2005-07-03 21:30:58 niro Exp $ + # Begin $rc_base/init.d/functions - Run Level Control Functions # Based on functions script from LFS-3.1 and earlier. @@ -48,7 +50,7 @@ # dummy function; needed if splashutils are not installed splash() { - return 0 + return 0 } @@ -106,7 +108,7 @@ then #check if statedir exists [ ! -d ${svcdir}/started ] && mkdir ${svcdir}/started - + #get real name of the initscript, not from the symlink if [ -L "$0" ] then @@ -387,3 +389,39 @@ echo "${mylist}" } + +# searches /proc/mounts for mounted fstypes (like ext3) +is_fstype_mounted() { + local filesys + local i + filesys=$1 + + i="$(cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3)" + [[ ${i} != ${filesys} ]] && return 1 + + return 0 +} + +# searches /proc/mounts for mounted fs names (like udev, proc) +is_fs_mounted() { + local filesys + local i + filesys=$1 + + i="$(cat /proc/mounts | grep ${filesys} | cut -d ' ' -f1)" + [[ ${i} != ${filesys} ]] && return 1 + + return 0 +} + +# checks if kernel supports fs xy +kernel_supports_fs() { + local filesys + local i + filesys=$1 + + i="$(cat /proc/filesystems | grep ${filesys} | cut -d $'\t' -f2)" + [[ ${i} != ${filesys} ]] && return 1 + + return 0 +}