#######################################################################
#  k5tool.conf - das Knoppicillin-Kommandozeilentool                  #
#  (c) 2007 Christiane Ruetten, Heise Zeitschriften Verlag            #
#  Die Vervielfaeltigung dieses Skriptes untersteht den Bedingungen   #
#  der GNU Public License.                                            #
#######################################################################
# Changelog:
#   1.0 - erste veroeffentlichungsreife Version
#   1.0.1 - Anpassungen fuer Version 5.2
#         - wget-Option --no-cache hinzu
#

HTTP_UPDATE='http://www.heise.de/ct/projekte/knoppicillin/k52dupdate.tgz'
UPDATE_DIR="k52update"
SYSUPDATE_NAME="k52update.tgz"
CD_DIR="/cdrom/KNOPPIX"
LOG_DIR="/tmp/k52logs"
LOG_NAME=k52.log

SYSUPDATE_SCRIPT="/k52update.sh"

# Scanner-Konfiguration ##########################
#
# Index 0: Avira
AVIRA=0

# Avira-Sektion ##################################

avshort[AVIRA]="a"
avlong[AVIRA]="Avira-AntiVir"
avinfo[AVIRA]='
  /usr/bin/antivir --version
'
avupdate[AVIRA]='
  conf=/etc/avupdater.conf
  host=$(echo $http_proxy | cut -d: -f2 | tr -d /)
  port=$(echo $http_proxy | cut -d: -f3 | tr -d /)
  line="HTTPProxyServer $host
HTTPProxyPort $port"
  if [ -n "$host" ]
  then
    grep -iv "^HTTPProxy" "$conf" >"${conf}~" \
      && mv "${conf}~" "$conf"
    echo "$line" >>"${conf}"
  fi
  /usr/bin/antivir --update
  case $? in
    0|1) exit 0 ;;
    *) exit 1 ;;
  esac
'
avsigsave[AVIRA]='
  wget "http://dl.antivir.de/down/vdf/ivdf_fusebundle_nt_en.zip" -O "$zip"
'
avsiginstall[AVIRA]='
  unzip -qo "$zip" -d /usr/lib/AntiVir/
'
avcheck[AVIRA]='
  if [ "$full" == "0" ]
  then
    /usr/bin/antivir --scan-mode=smart --alltypes -s --archive-max-recursion=10 -nolnk -ra -r1 -rf"$log" "$dir"
  else
    /usr/bin/antivir --scan-mode=all -z --alltypes -s --archive-max-recursion=50 -nolnk -ra -r1 -rf"$log" "$dir"
  fi
  case $? in
    2??) exit 1 ;;
    *) exit 0 ;;
  esac
'
avdisinfect[AVIRA]='
  if [ "$full" == "0" ]
  then
    /usr/bin/antivir -del --scan-mode=smart --alltypes -s --archive-max-recursion=10 -nolnk -ra -r1 -rf"$log" "$dir"
  else
    /usr/bin/antivir -del --scan-mode=all -z --alltypes -s --archive-max-recursion=50 -nolnk -ra -r1 -rf"$log" "$dir"
  fi
  case $? in
    2??) exit 1 ;;
    *) exit 0 ;;
  esac
'

# Beispiel-Sektion ###############################

#avshort[]="x"
#avlong[]="Beispiel-Scanner"
#avinfo[]='
#  echo Scanner-Info ausgeben
#'
#avupdate[]='
#  echo Netz-Update starten
#'
#avsigsave[]='
#  echo Signaturarchiv in $zip anlegen
#'
#avsiginstall[]='
#  echo Signaturarchiv aus $zip einspielen
#'
#avcheck[]='
#  echo read-only Scan-Durchlauf von $dir starten
#'
#avdisinfect[]='
#  echo Viren in $dir loeschen
#'

