1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
#!/bin/sh
# $Header: /home/kbackup/CVSROOT/KBackup/src/checkprogs,v 1.10 1997/09/19 19:49:25 kbackup Exp $
#
# This file is Copyright (C) 1995-1997 by Karsten Ballder (Ballueder@usa.net)
#
# It is part of the KBackup package, see the file COPYING for details.
# KBackup and all files included in this package are licensed and protected
# under the terms and conditions of the GNU General Public License Version 2.
#
# If you want to contact the current maintainer of this software, please
# send e-mail to: KBackup@usa.net
# Or visit the KBackup-Homepage at http://KBackup.home.ml.org/
#
#
HasSED=NO
HasDIALOG=NO
HasTAR=NO
HasAFIO=NO
HasAFIO242=NO
HasFGREP=NO
HasGREP=NO
HasDD=NO
HasNot=
MYDIALOGTITLE="KBackup"
export HasSED HasDIALOG HasTAR HasAFIO HasDD HasNot
mydialog()
{
dialog --backtitle "$MYDIALOGTITLE" "$@"
}
check_progs()
{
clear
echo -n "Checking for required programs: "
if [ "$TTYMODE" != YES ]
then
echo -n "$DIALOG "
$DIALOG 2>/dev/null
if [ $? != 127 ] ;then HasDIALOG=YES ; else HasNot="$HasNot $DIALOG";fi
if [ $HasDIALOG = YES ]
then
$DIALOG --backtitle "test" --infobox "test" 5 20 2>/dev/null && clear
if [ $? = 0 ]
then
DIALOG=mydialog
fi
fi
clear
echo -n "Checking for required programs: "
echo -n "$DIALOG "
else
DIALOG=mydialog
fi
echo -n "$SED "
$SED 2>/dev/null
if [ $? != 127 ] ;then HasSED=YES ; else HasNot="$HasNot $SED";fi
echo -n "$FGREP "
$FGREP 2>/dev/null
if [ $? != 127 ] ;then HasFGREP=YES ; else HasNot="$HasNot $FGREP";fi
echo -n "$GREP "
$GREP 2>/dev/null
if [ $? != 127 ] ;then HasGREP=YES ; else HasNot="$HasNot
$GREP";fi
echo -n "$TAR "
$TAR 2>/dev/null
if [ $? != 127 ] ;then HasTAR=YES ; else HasNot="$HasNot $TAR";fi
echo -n "$AFIO "
$AFIO 2>/dev/null
if [ $? != 127 ]
then
HasAFIO=YES
$AFIO -V | $SED '1,$ s/^.*Version \([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*$/a=\1;b=\2;c=\3/g' >/tmp/.tmp$$
. /tmp/.tmp$$
rm -f /tmp/.tmp$$
ver=`expr \( \( $a \* 100 \) + $b \) \* 100 + $c `
if [ $ver -gt 20401 ]
then
HasAFIO242=YES
echo -n "(2.4.2 or newer) "
fi
else
HasNot="$HasNot $AFIO"
fi
echo "$DD "
$DD 2>/dev/null </dev/null
if [ $? != 127 ] ;then HasDD=YES ; else HasNot="$HasNot $DD";fi
if [ $HasDIALOG != YES -a "$TTYMODE" != YES ]
then
echo -e "\n\aCannot find dialog program!
Running in simple shell mode instead.
Press Enter to continue..."
read
fi
if [ $HasDIALOG = NO -o "$TTYMODE" = YES ] && [ "$DIALOG_SRC_FILE" != "" ]
then
echo -e "\tLoading dialog-emulation script..."
. "$DIALOG_SRC_FILE"
DIALOG=mydialog
fi
}
report_missing()
{
if [ "$HasNot" != "" ]
then
echo "
The following programs are not installed or their paths are not set
properly. For full functionality of KBackup you should install them.
missing: $HasNot
"
if [ "$1" != "-noprompt" ]
then
echo -en "\aPress RETURN key to continue anyway..."
read
fi
fi
}
|