diff options
author | Matt Woelk | 2016-04-26 14:30:34 -0500 |
---|---|---|
committer | Matt Woelk | 2016-04-26 14:30:34 -0500 |
commit | cad3263cae3e5d435760a162497280b3b3c0a3ea (patch) | |
tree | a6e6524887a68875e2969bf88b68fb87b5fd5490 /getnessus.sh | |
parent | 42b633e595e618fc9a49c554901c09c86d17f92a (diff) | |
download | aur-cad3263cae3e5d435760a162497280b3b3c0a3ea.tar.gz |
Added download script from vendforce.
Diffstat (limited to 'getnessus.sh')
-rwxr-xr-x | getnessus.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/getnessus.sh b/getnessus.sh new file mode 100755 index 000000000000..6f340f2fd083 --- /dev/null +++ b/getnessus.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Created by vendforce for the Matthew Woelk in the arch AUR +# Nessusdownlader is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Nessusdownlader is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +#### Wget https settings +WGET_HSTS="--no-hsts" + +#### Check for the latest availible version, and get the current changlog version +VERSION=$(wget $WGET_HSTS -qO - /dev/null "http://www.tenable.com/products/nessus/new-in-nessus" | grep -o "New in Nessus [0-9.0-9.0-9]*" | grep -o "[0-9.0-9.0-9]*" | head -1 | sed s/[.]/-/g) +RELEASE=$(wget $WGET_HSTS -qO - /dev/null http://www.tenable.com/products/nessus/new-in-nessus/$VERSION | grep -o "Changelog - [0-9.0-9.0-9]*" | head -1 | awk '{print $NF}') + +for FEDORA in {0..9} + do +ID=$(wget $WGET_HSTS -qO - /dev/null "https://downloads.nessus.org/nessus3dl.php?file=Nessus-$RELEASE-fc2$FEDORA.x86_64.rpm&licence_accept=yes" | grep "og:description" | cut -d= -f3 | sed -e 's/^"*//' | cut -d* -f1) + DOWNLOAD=$(wget $WGET_HSTS -O/dev/null -q "http://downloads.nessus.org/nessus3dl.php?file=Nessus-$RELEASE-fc2$FEDORA.x86_64.rpm&licence_accept=yes&t=$ID" && echo "exists" || echo "not exist") +if [[ $DOWNLOAD == exists ]] ;then + wget $WGET_HSTS -q "http://downloads.nessus.org/nessus3dl.php?file=Nessus-$RELEASE-fc2$FEDORA.x86_64.rpm&licence_accept=yes&t=$ID" -O Nessus-$RELEASE-fc2$FEDORA.x86_64.rpm + break +else + echo "Doesn't Exist" > /dev/null + break +fi +done |