#!/bin/sh
#INIT 60

case $1 in
autostop) ;;
autostart)
	exec sh $0 start
	;;
start)
	grep -v "^#" /etc/fstab| grep cifs >/dev/null 2>&1
	if [ $? -eq 0 ];then
		grep cifs /proc/filesystems >/dev/null 2>&1
		if [ $? -eq 0 ];then
			mount -a -t cifs
		else
			logger -t cifs "No cifs support in kernel"
		fi
	fi
	;;
stop)
	grep -v "^#" /etc/fstab| grep cifs >/dev/null 2>&1
	if [ $? -eq 0 ];then
		umount -a -t cifs
	fi
	;;
restart)
	sh $0 stop
	sh $0 start
	;;
*)
	echo "Usage: $0 {start | stop | restart}"
	exit 1
	;;
esac
exit $?
