preinst is in openvas-plugins-dfsg 1:20100705-4ubuntu1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #!/bin/sh
#
# Preinst script for openvas-plugins
# Copyright (c) 2004-2007 Javier Fern�ndez-Sanguino
set -e
PLUGINDIR=/var/lib/openvas/plugins/
OPLUGINDIR=/usr/lib/openvas/plugins/
# Basicly, check if there is any NASL script in the old plugins directory
[ ! -d $OPLUGINDIR ] && exit 0
[ -n "`ls $OPLUGINDIR/* 2>/dev/null |grep -v \.nes `" ] && exit 0
echo -n "Moving NASL plugins and include files from $OPLUGINDIR to $PLUGINDIR ..."
if [ ! -d $PLUGINDIR ] ; then
mkdir -p $PLUGINDIR
chown root:root $PLUGINDIR
chmod 0766 $PLUGINDIR
fi
# Now, we don't care about descriptions, they will be regenerated
[ -d "$OPLUGINDIR/.desc" ] && rm -rf $OPLUGINDIR/.desc
[ ! -d "$PLUGINDIR/.desc" ] && mkdir $PLUGINDIR/.desc
# Move everything except for NES files
find $OPLUGINDIR -maxdepth 1 -mindepth 1 ! -name *.nes |
while read content; do
base=`basename $content`
if [ -e "$PLUGINDIR/$base" ]; then
cp -a "$OPLUGINDIR/$base" $PLUGINDIR
rm -rf "$OPLUGINDIR/$base"
else
mv "$OPLUGINDIR/$base" $PLUGINDIR
fi
done
echo ".done"
exit 0
|