#!/bin/sh # sets variables (need to be set here because /etc/profile is not called # until later) #chmod o-w /tmp #chgrp temp /tmp if [ $USER = lbhs ] then IP_ADDRESS=`echo "$DISPLAY"|awk -F: '{ print $1 }'` HOME=/var/xterminals/$IP_ADDRESS/home /usr/bin/X11/xset dpms 0 0 0 temp_ip=`echo "$IP_ADDRESS"|awk -F. '{ print $3"."$4 }'` # this is the user we will switch to after we are logged in NEW_USER=term$temp_ip # if the drive is still mounted (terminal not logged out properly) unmap it temp=`/bin/grep $IP_ADDRESS /etc/mtab` if test temp then /bin/umount /mnt/xterminals/$IP_ADDRESS fi # create user if does not exit if ! /bin/cat /etc/passwd | /bin/grep $NEW_USER then /usr/sbin/useradd -M $NEW_USER -d $HOME # remove password /usr/bin/passwd -d $NEW_USER fi # if home exists, remove it if /usr/bin/test -d $HOME then /bin/rm -rf $HOME fi # ...and recreate it cp -a /var/xterminals/10.1.1.1/home /var/xterminals/$IP_ADDRESS # tells star office where to look for its files echo [Versions] > $HOME/.sversionrc echo StarOffice 5.2=$HOME/office52 >> $HOME/.sversionrc echo >> $HOME/.sversionrc # and where the mount point is /usr/local/bin/rfindrep -m . -f 10.1.1.1 -r $IP_ADDRESS $HOME/office52/user/ > /dev/null # give the user permission to its home directory /bin/chown -R $NEW_USER:$NEW_USER $HOME # if mount point does not exist, create it if ! test -d /mnt/xterminals/$IP_ADDRESS then mkdir /mnt/xterminals/$IP_ADDRESS touch /mnt/xterminals/$IP_ADDRESS/.not-mounted chown $NEW_USER:$NEW_USER /mnt/xterminals/$IP_ADDRESS fi fi