home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- # SCCS Id: @(#)nethack.sh 3.1 90/02/26
-
- GAMEDIR=/usr/skunk/games/lib
- FONTDIR=/usr/games/lib/nethackdir/fonts
- HACKDIR=/usr/games/lib/nethackdir
- HACK=$GAMEDIR/nethack
- MAXNROFPLAYERS=4
- NETHACKOPTIONS=$HACKDIR/nethack.rc
- export NETHACKOPTIONS
-
- # see if we can find the full path name of PAGER, so help files work properly
- # assume that if someone sets up a special variable (HACKPAGER) for NetHack,
- # it will already be in a form acceptable to NetHack
- # ideas from brian@radio.astro.utoronto.ca
- if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \)
- then
-
- HACKPAGER=$PAGER
-
- # use only the first word of the pager variable
- # this prevents problems when looking for file names with trailing
- # options, but also makes the options unavailable for later use from
- # NetHack
- for i in $HACKPAGER
- do
- HACKPAGER=$i
- break
- done
-
- if test ! -f $HACKPAGER
- then
- IFS=:
- for i in $PATH
- do
- if test -f $i/$HACKPAGER
- then
- HACKPAGER=$i/$HACKPAGER
- export HACKPAGER
- break
- fi
- done
- IFS=' '
- fi
- if test ! -f $HACKPAGER
- then
- echo Cannot find $PAGER -- unsetting PAGER.
- unset HACKPAGER
- unset PAGER
- fi
- fi
-
-
- if [ "$DISPLAY" ]
- then
- xset +fp $FONTDIR
- else
- NETHACKOPTIONS=windowtype:tty
- export NETHACKOPTIONS
- fi
- cd $HACKDIR
- case $1 in
- -s*)
- exec $HACK "$@"
- ;;
- *)
- exec $HACK "$@" $MAXNROFPLAYERS
- ;;
- esac
- [ "$DISPLAY" ] && xset -fp $FONTDIR
-