#!/bin/csh -f
#
# icon will be created in $HOME/`whoami`.home, and will appear on
# the user's own WhatsNew page
#
#

set fullhost=`hostname`

# Three cases are handled here:
#   /usr/bin/domainname exists and the domain name has been set
#	strip domainname (if any) from fullhost; server = hostonly.domainname
#
#   /usr/bin/domainname exists but the domain name is not set
#	server = fullhost
#
#   /usr/bin/domainname does not exist (NIS not installed)
#	server = fullhost
#
if ( -x /usr/bin/domainname ) then
    set hostonly=`echo ${fullhost} | sed -e 's/\..*$//'`
    set thisdomain=`/usr/bin/domainname`
    if ( ${thisdomain} != "" ) then
	set server=${hostonly}.${thisdomain}
    else
	set server=${fullhost}
    endif
else
    set server=${fullhost}
endif

set loginname=`whoami`

set iconfile=$HOME/${loginname}.home

echo "#SGIWebJumpsite" > ${iconfile}
echo "" >> ${iconfile}
echo "http://${server}/~${loginname}" >> ${iconfile}

/usr/sbin/iconbookedit -add "Category:File Name:${iconfile}" -userpage WhatsNew >& /dev/null

