while [ -z "$R" ];do echo ${n}Enter the $2 $d $c;read a
if [ "$a" ];then R=$a;elif [ -n "$1" ];then R=$1;
else e="No $2 entered";ac||exit 0;fi;done;}
# main
if [ ! -t 0 ];then e="This program must not be piped into a shell";ab;fi
if [ ! -f $s ];then e="$s not found";ab;fi
if [ ! -f $f ];then e="$f not found";ab;fi
if [ ! -f $i ];then e="$i not found";ab;fi
echo $n$n${t}YOU are responsible for running this program.$n$n${t}Clauses 9 and 10 of the GNU GENERAL PUBLIC LICENSE$n${t}apply to this program.$n$n${t}If you continue, you thereby agree that its author, $n${t}nor his employer, nor anybody else except yourself, has any $n${t}liablity for any loss, damage etc. etc.$n
ac||exit 1
echo $n$n${t}Fixable versions with the $b bug$n$n$t$t[1]$t ESIX 4.0.3A$n$t$t[2]$t ESIX 4.0.4$n$t$t[3]$t DELL 2.1$n$t$t[4]$t Consensys 1.3$n
R=1;qu "$R" "SVR4 flavor this system is running"
case $R in 1)o=$esix403_o;; 2)o=$esix404_o;;3)o=$dell21_o;; 4)o=$cons13_o;;
*)e="Invalid answer";ab;;esac
echo $n${t}Looking for replacement target ... $c
if echo $o:?lx|$s -e $f 2>$N|grep $o/$v>$N;then echo found
if yn "Do you want to patch the kernel now?" "n";then
cr||ab
qu "$f.orig" "name of backup file"
if [ -f $R ];then e="File $R already exists";ab;fi
if cp $f $R;then echo $n${t}Copied $f to $R;else e="Failed to write $R";ab;fi
if echo $o!$r|$s -e -w $f>$N 2>&1;then
echo ${n}Fixed $b bug, you may now run $i and reboot$n;else e="$s failed";pe
if cp $R $f;then echo $n${t}Copied $R to $f;else e="Restore $f failed";pe;fi
e="Patch failed!!";ab;fi
fi
else echo not found;e="Replacement target not found at expected offset";ab;fi