[pptp-server] auto-login mount
Jason Staudenmayer
jasons at NJAQUARIUM.ORG
Fri Nov 30 16:12:41 CST 2001
Here's a Samba preexec script to automount Novell vols. per samba user
login.
under the [homes] in smb.conf
preexec = /etc/samba/myncpmount %u
the contents of the myncpmount file:
-----
#!/bin/bash
# written by:Alan C.
# debugged and tested by:Jason S.
[ "x$1" = "x" ] && exit 1
USER=$1
PASS=`awk '/^'$USER' / {print $2}' /etc/samba/ncpasswd`
SERV=`awk '/^'$USER' / {print $3}' /etc/samba/ncpasswd`
VOL=`awk '/^'$USER' / {print $4}' /etc/samba/ncpasswd`
PATH=`awk '/^'$USER' / {print $5}' /etc/samba/ncpasswd`
#(tilde)awk (apos)/^(apos)$1(apos) / (print $2}(apos)
/etc/samba/ncpasswd(tilde)
#check for a no match of username somewhere
[ "x$SERV" = "x" ] && exit 1
echo /usr/bin/ncpmount -U $USER -P $PASS -S $SERV -V $VOL $PATH
-----EOF
format for the ncpasswd:
username password server volume mountdir
**** MUST USE SPACES NOT TABS ******
make both files 755
have phun. I'm still working on the auto umount for this
should have it soon. And maybe some better docs.
More information about the pptp-server
mailing list