Sunday, March 8, 2015

setting up autofs users home dir local and nfs

bash-3.2# cat /etc/auto.home
#!/bin/ksh
NONAS='
# specify local mounts
jay -rw     samserv01:/export/home:&
dev -rw     samserv01:/export/home:&
ram -rw     samserv02:/export/home:&
'
if [ -x /etc/auto_home_local ]; then
        exec /etc/auto_home_local $1
        exit 0
fi
if ( echo "$NONAS" |grep "^$1[  ]" >/dev/null 2>&1 ); then
        echo "$NONAS" | grep "^$1[      ]" | awk '{print $NF}'
        exit 0
fi
case $1 in
        nobody|nobody2) exit
        ;;
        [rk][0-9][0-9]*) echo sama:/export/home/$1
        ;;
        [A-Za-z]*) echo sam:/export/home/$1
        ;;
esac
bash-3.2# hostname
myclienthost
bash-3.2#
bash-3.2# ls -l /etc/auto_home_local
/etc/auto_home_local: No such file or directory

No comments:

Post a Comment