--- autofs	2003-11-27 23:22:18.000000000 +0100
+++ autofs.new	2003-11-29 19:58:19.000000000 +0100
@@ -36,14 +36,16 @@
 #
 # Determine which kind of configuration we're using
 #
+# Try 'generic' if you have an unsupported system.
+#system=generic
+
 system=unknown
 if [ -f /etc/debian_version ]; then
     system=debian
 elif [ -f /etc/redhat-release ]; then
     system=redhat
-else
+elif [ "$system" = "unknown" ]; then
     echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2
-    exit 1
 fi
 
 if [ $system = redhat ]; then
@@ -139,6 +141,14 @@
                 ;;
         esac
     done
+    if [ -z "`getschemes`" ]; then
+        # automount entry in /etc/nsswitch.conf not found
+	if [ -z "$filescheme" ] ; then
+		getfilemounts
+		filescheme=1
+		export filescheme
+	fi
+    fi
 }
 
 
@@ -401,11 +411,59 @@
 esac
 }
 
+
+#
+# Generic start/stop function.
+#
+function generic()
+{
+
+case "$1" in
+  start)
+        # Make sure the autofs filesystem type is available.
+        (grep -q autofs /proc/filesystems || /sbin/modprobe -k autofs4 || /sbin/modprobe -k autofs) 2> /dev/null
+        TMP=`mktemp /tmp/autofs.XXXXXX` || { echo $"could not make temp file" >& 2; exit 1; }
+        getmounts | tee $TMP | sh
+        RETVAL=$?
+	if [ -s $TMP ] ; then
+	    [ $RETVAL = 0 ] || echo "Starting automounter failed"
+	else
+	    echo "No Mountpoints Defined"
+	fi
+	rm -f $TMP
+	echo
+	;;
+  stop)
+	killall -USR2 $DAEMON 2> /dev/null
+	count=0
+	while [ -n "`pidof $DAEMON`" -a $count -lt 10 ] ; do
+	   killall -USR2 $DAEMON 2> /dev/null
+	   RETVAL=$?
+	   [ $RETVAL = 0 -a -z "`pidof $DAEMON`" ] || sleep 3
+	   count=`expr $count + 1`
+	done
+	umount -a -f -t autofs
+	echo
+	;;
+  restart)
+	generic stop
+	generic start
+	;;
+  status)
+	status
+	;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|status}"
+esac
+}
+
 RETVAL=0
 if [ $system = debian ]; then
 	debian "$@"
 elif [ $system = redhat ]; then
 	redhat "$@"
+elif [ $system = generic ]; then
+	generic "$@"
 fi
 
 exit $RETVAL
