#!/bin/csh -f # # write a 'hostname'.sh file in $HOME/.dt for use in dtwmrc # # kevin inscoe (inscoe@iag.net) 12/22/97 # # # get the hostname we want to create # if ( $1 == "" ) then /usr/ucb/echo -n "Enter hostname (fully qualified domainname) to create dt shell script for: " set newhost = $< else set newhost = $1 endif set newhostname = `/bin/echo $newhost | /bin/cut -f1 -d.` set output = "$HOME/.dt/`echo $newhostname`.sh" # # get out IP address # set IP = `ifconfig -a | tail -1 | cut -f2 -d" "` # # write out new script # if ( -e $output ) rm -f $output /bin/touch $output /bin/chmod +x $output /usr/ucb/echo -n "set IP = `ifconfig -a | tail -1 | cut -f2 -d' '`;" >> $output /usr/ucb/echo -n "/usr/bin/rsh $newhost " >> $output /usr/ucb/echo -n '"' >> $output /usr/ucb/echo -n "source .login; source .cshrc; setenv DISPLAY " >> $output /usr/ucb/echo -n "`/bin/echo $IP`:0; xterm `/bin/echo $XTERM` -title " >> $output #/usr/ucb/echo -n "$IP:0; /usr/openwin/bin/xterm -title " >> $output /usr/ucb/echo -n $newhostname >> $output /bin/echo '"' >> $output