#! /bin/sh #---------------------------------------------------------------------------- # doc - ask user for doc view # # usage: doc file # # return values: # 0 pager started # 1 pager not started # # Copyright (c) 2003-2004 Frank Meyer # # Creation: 28.08.2003 fm # Last Update: $Id$ # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- docfile=$1 pager=$PAGER if [ "$pager" = "" ] then pager=less fi echo echo echo "The documentation will be shown using '$PAGER'" case $pager in *less) echo "You can get help by typing the key 'h', 'q' to quit.";; *more*) echo "You can get help by typing the key 'h', 'q' to quit.";; *vi|*view ) echo "You can get help by typing :h, :q to quit.";; *) true;; esac echo rtc=1 if /var/install/bin/ask "Continue" then if [ -f $docfile -a -s $docfile ] then export LESSCHARSET=latin1 $pager $docfile if [ $? != 0 ] then colecho "pager $PAGER invalid!" br x br colecho "check variable PAGER" br x br else rtc=0 fi else colecho "Could not find desired documentation!" br x br fi /var/install/bin/anykey fi exit $rtc