#!/bin/csh # Copyright 11/09/98 Sun Microsystems, Inc. All Rights Reserved. # "@(#)findnwsegno 1.1 98/11/09 Sun Microsystems" source ./profile.csh if ( "$2" == "" ) then echo "Usage : $0 Novell_Server_Name Unix_User" exit 1 endif # first check if the NetWare server is accessible set serverlist=`$NF_SBIN/netcslist` if ( "$serverlist" == "" ) then # it is the first time to login in echo "1" exit 0 endif set in=`echo $serverlist | grep -iw "$1"` if ( "$in" == "" ) then echo "The NetWare server '$1' is not known to this server." exit 1 endif set ff="File+Servers=$1&request=Update+Mapped+User" set len=`echo $ff | awk ' { print length($1) } '` echo "$ff" > /tmp/input.$$ setenv SERVER_PORT 880 setenv REMOTE_HOST localhost setenv REQUEST_METHOD POST #setenv HTTP_ACCEPT 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*' setenv CONTENT_TYPE 'application/x-www-form-urlencoded' setenv CONTENT_LENGTH $len $NF_NCLIB/www/cgi-bin/map.cgi < /tmp/input.$$ > /tmp/map.cgi.$$ sleep 1 rm -f /tmp/input.$$ > /dev/null # find the new segno set newsegno=`grep -w "segno" /tmp/map.cgi.$$ | sed 's/.*value="//' | sed 's/".*//'` if ( "$newsegno" == "" ) then echo "Connection to the Novell server '$1' failed." exit 1 endif cp -f /tmp/map.cgi.$$ /tmp/save # grep all the user mappings grep "