Commit 70c51aed authored by Francesco Colista's avatar Francesco Colista

community/openvas-scanner: updated periodic script, added check()

parent e99ca392
......@@ -4,12 +4,13 @@ pkgname=openvas-scanner
_pkgname=openvassd
pkgver=5.1.1
_pkgid=2423
pkgrel=1
pkgrel=2
pkgdesc="The OpenVAS scanning Daemon"
url="http://www.openvas.org/"
arch="all"
license="GPL"
depends="redis nmap coreutils libressl"
checkdepends="cppcheck"
makedepends="cmake openvas-libraries-dev glib-dev
doxygen xmltoman"
subpackages="$pkgname-doc"
......@@ -18,11 +19,16 @@ source="http://wald.intevation.org/frs/download.php/$_pkgid/$pkgname-$pkgver.tar
$_pkgname.confd
$_pkgname.conf
$_pkgname.logrotate
openvas-nvt-sync.cron
greenbone-nvt-sync.cron
002-execinfo-musl-fix.patch"
builddir="$srcdir"/$pkgname-$pkgver
check() {
cd "$builddir"
make check
}
build() {
cd "$builddir"
cmake -DCMAKE_BUILD_TYPE=Release \
......@@ -30,7 +36,7 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc \
-DLOCALSTATEDIR=/var .
make || return 1
make
}
package() {
......@@ -40,8 +46,8 @@ package() {
install -m755 -D "$srcdir"/$_pkgname.initd "$pkgdir"/etc/init.d/$_pkgname
install -m755 -D "$srcdir"/$_pkgname.confd "$pkgdir"/etc/conf.d/$_pkgname
install -m755 -D "$srcdir"/$_pkgname.conf "$pkgdir"/etc/openvas/$_pkgname.conf
install -Dm744 "$srcdir"/openvas-nvt-sync.cron \
"$pkgdir"/etc/periodic/daily/openvas-nvt-sync
install -Dm744 "$srcdir"/greenbone-nvt-sync.cron \
"$pkgdir"/etc/periodic/daily/greenbone-nvt-sync
mkdir -p "$pkgdir"/usr/share/doc/$_pkgname
cat >"$pkgdir"/usr/share/doc/$_pkgname/README.alpine <<EOF
......@@ -66,5 +72,5 @@ fe8f81ac4d326611d077dc2c81d74f8e1e2c7b9e10eaaf3d30b2dcd8d2ede40ec060ff70678bda74
47304976c18f1a561aec8e21406864d086898153b307dcc8e92117c400c9379e448920c2bbebc4b0b18fbb65c19a3d00d4d3e24a1a9a81d788a59fdc40bc0154 openvassd.confd
0d203cd2dfcf0b77ce8d2546235de16f23ea71c7e601db557fcd67e9c8dc460029494f1a146daadb44101ae194d7fa4d511a488bb69094e5470de9e10acf008b openvassd.conf
5934a31ef4b7267fd741c41bb97fe2e1e42735d2324cce07145de1942efae3f5e42e8652ec0c3482dd53477be420a58124eae943f254105547abf065febb9046 openvassd.logrotate
92f1700ba15e04f0d830ac04db8c61bffb06104692fd91386a7f67ad8cc4bd1ea92651207a615c4bc56abc3a6c4f2fcf54fad52779fe5c6169d38f98b83513ea openvas-nvt-sync.cron
da53e5c5e3ab70749249c2bf6c4fe0e0d17a2afb39d4519eb7fdf873c3fedf925183db050ab5395a3fe7f1ce79d95bf4f55c69611205d00dc519ce15418bd915 greenbone-nvt-sync.cron
e7930a80b47213dbe3f4d4266ab9ad778f67c3b33a1e94578527d78335b2db05ced1ede893f656e6da98278c7c060a2ced8156a61dfbf15a74d7987ae1cdb745 002-execinfo-musl-fix.patch"
#!/bin/sh
/usr/bin/greenbone-nvt-sync >& /dev/null
/usr/bin/greenbone-scapdata-sync >& /dev/null
/usr/bin/greenbone-certdata-sync >& /dev/null
#!/bin/sh
if [ -f /etc/openvas/openvassd.conf ]; then
. /etc/openvas/openvassd.conf
fi
if [ "$auto_plugin_update" != "yes" ]; then
exit 0
fi
opts=""
case "$update_method" in
rsync)
opts = "$opts --rsync"
;;
wget)
opts = "$opts --wget"
;;
curl)
opts = "$opts --curl"
;;
esac
# Export openvas-nvt-sync's environment variables if they are defined
[ \! -z "$NVT_DIR" ] && export NVT_DIR
[ \! -z "$OV_RSYNC_FEED" ] && export OV_RSYNC_FEED
[ \! -z "$OV_HTTP_FEED" ] && export OV_HTTP_FEED
/usr/sbin/openvas-nvt-sync $opts >& /dev/null
if [ $? -ne 0 ]; then
echo "Error updating OpenVAS plugins. Please run openvas-nvt-sync manually."
exit 1
fi
if [ "$notify_openvas_scanner" == "yes" ]; then
/etc/init.d/openvas-scanner reloadplugins
fi
#!/bin/sh
echo "Remember to modify redis server in order to listen to a socket"
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment