#!/bin/sh # # /etc/auto.intra (0755): workstation autofs configuration # # Linux autofs script to determine and mount known available mount points # PARAMS="-fstype=nfs,rw,bg,soft,intr,nosuid,rsize=8192,wsize=8192,proto=tcp,vers=3 -strict" SERVER="192.168.1.1" # Determine that we are accessing known mount points if [ "$SERVER" != "$1" ] then exit 1 fi # $SERVER is also the default gateway in our intranet GW=`route -n | grep ^0.0.0.0 | awk '{print $2}'` if [ "$SERVER" != "$GW" ] then exit 1 fi # Determine available mount points AVAIL=`showmount --no-headers -e $SERVER | awk '{print $1}' | tr '\n' ' '` if [ -z "$AVAIL" ] then exit 1 fi # Output mount points in correct format echo -n $PARAMS for a in $AVAIL do echo -n " $a $SERVER:$a" done echo