if [ -e $HOME/.nwinfos ]; then #Netware authenticated with forced creation of a $HOME/.nwinfos file ( zen flag I is turned on ) source $HOME/.nwinfos #use $NDS_* values else #LDAP or local account fi
Requirements:
Usage:
Here is a "real life example":
NDS_USER=flardet NDS_GECOS="Florie Anne Lydie Lardet" NDS_SHELL=/bin/bash NDS_HOME=/cipc/eurinsa/2210126 NDS_UID=14694 NDS_GID=100 NDS_QFLAG=2033 NDS_HOME_SERVER=EURINSA NDS_HOME_VOLUME=APPS NDS_HOME_PATH=HOME/03/2210126 NDS_HOME_MNT_PNT=/mnt/ncp/flardet/nwhome NDS_EMAIL=florie.lardet@insa-lyon.fr NDS_EMAIL=florie.lardet@insa-lyon.fr NDS_PREFERRED_SERVER=EURINSA NDS_PREFERRED_TREE=INSA_ROOT NDS_PREFERRED_NAME_CTX=PC NDS_IS_NEW_USER=0 NDS_ZEN_FLAG=0xfc0c7101 NDS_BCAST=0
Some real life examples:
#!/bin/sh #zenscript0 #run at session opening by pam_ncp_auth.so for a new acccount # standard heading #run with user permissions source $1/$2 #create a link in user's home to the real mount point of his Netware home (the mount point is the same on every workstation) [ ! -e $1/nwhome ] && ln -s $NDS_HOME_MNT_PNT $1/nwhomeAnd on every new student Desktop we copy(from /etc/skel/Desktop) a shortcut with a big red N icon and a link to a KDE application with the following command line:
Exec=kfmclient openURL '$HOME/nwhome'
The PAM module will automatically umount users' Netware home at logout, but not any other Netware resources that could have been mounted during the session. So the following script will take care of closing all opened Netware connections: #!/bin/sh #zenscript5 #last run at session closing by pam_ncp_auth.so # standard heading source $1/$2 /usr/local/bin/ncplogout -a
#!/bin/bash
#copy initial preferences for kde and kmail
#personnalize some files for current user
#PP 06/06/2002
#PP 26/09/02 ajout IMAP in Account 2
source /etc/profile.d/commun.cipc
#first login, no KDE config files
if [ ! -e $HOME/.kde ]; then
cp -Rf /etc/skel/.kde $HOME
cp -f /etc/skel/.first_start_kde $HOME
fi
#copy initial Desktop with our specific icons
if [ ! -d $HOME/Desktop ]; then
cp -Rf /etc/skel/Desktop $HOME
fi
# replace all __XXXX__ strings with current user's values in rc files just copied from /etc/skel
if [ ! -e $HOME/Mail ]; then
changeini $HOME/.kde/share/config/emaildefaults PROFILE_Default EmailAddress $EMAIL
changeini $HOME/.kde/share/config/emaildefaults PROFILE_Default FullName "$GECOS"
mkdir "$HOME/Mail"
chmod 700 "$HOME/Mail"
[ ! -f $HOME/.kde/share/config/kmailrc ] && cp /etc/skel/.kde/share/config/kmailrc $HOME/.kde/share/config/
changeini $HOME/.kde/share/config/kmailrc "Account 1" login $USER
changeini $HOME/.kde/share/config/kmailrc "Account 1" host "$POPSERVER"
changeini $HOME/.kde/share/config/kmailrc "Account 2" Name "$EMAIL"
changeini $HOME/.kde/share/config/kmailrc "Account 2" login "$USER"
changeini $HOME/.kde/share/config/kmailrc "Addressbook" default "$HOME/.kde/share/apps/kmail/addressbook"
changeini $HOME/.kde/share/config/kmailrc "Identity" "Email Address" $EMAIL
changeini $HOME/.kde/share/config/kmailrc "Identity" "Reply-To Address" $EMAIL
changeini $HOME/.kde/share/config/kmailrc "Identity" Name "$GECOS"
fi
#common.cipc, included in all our /etc/profile.d scripts
if [ -e $HOME/.nwinfos ]; then
#login via ncpfs PAM module
source $HOME/.nwinfos
GECOS=$NDS_GECOS
POPSERVER="$NDS_PREFERRED_SERVER.insa-lyon.fr"
if [ ! -z "$NDS_EMAIL" ]; then
EMAIL="$NDS_EMAIL"
else
EMAIL="$NDS_USER@$POPSERVER"
fi
else
#login via LDAP
POPSERVER="xxxx.insa-lyon.fr"
EMAIL="$USER@$POPSERVER"
GECOS=`getgecos.pl $USER`
fi
changeini is a small pascal Object program (compile on Linux or Windows) that replace a string by another one in a section of a "Windows style inifile". changetext is a small pascal Object program (compile on Linux or Windows) that replace all occurences of a string by another one in a text file.
History:
TODO:
Vous êtes notre eme visiteur