# int askYesNo(str question) - Ask for a y/n response
# return: 1=yes, 0=no
#
function askYesNo {
RV=""
loop=1
while[$loop-eq 1 ];do
echo"$1"
echo-n"(y/n): "
read r
echo$r | grep-q-i"y"
if[$?-eq 0 ];then
RV=1
loop=0
fi
echo$r | grep-q-i"n"
if[$?-eq 0 ];then
RV=0
loop=0
fi
done
return$RV
}
#
# void setup() - Setup aideCheck.sh configuration
#
function setup {
echo"Now we will setup aideCheck.sh"
echo" "
echo"You will get only one summary email if files are added/changed/modified"
echo"You will not get any emails if you leave the destination address blank"
echo" "
askYesNo "Would you know when files are changed ?"
ON_CHANGED=$?
askYesNo "Would you know when files are added ?"
ON_ADDED=$?
askYesNo "Would you know when files are deleted ?"
ON_DELETED=$?
askYesNo "Would you update A.I.D.E. database after running a check (usefull for a few rounds and tackle false positives, not recommeded in production) ?"
ON_UPDATE=$?
echo"Enter the destination email addres (leave empty if you don't want emails, and only check the return value of aideCheck.sh):"
read TO_MAIL
echo" "
}
#
# void patch() - Patch aideCheck.sh with the configuration