diff options
author | Matt Woelk | 2016-07-06 16:44:47 -0500 |
---|---|---|
committer | Matt Woelk | 2016-07-06 16:44:47 -0500 |
commit | 2695c99ac08387362aeed46619729ccfbe870045 (patch) | |
tree | 1f9792e6658dd060a095f1e75f620b1b0e39c226 | |
parent | 3ba60dfcf9fb3c1c3b556fa8acc945d444cd4af5 (diff) | |
download | aur-2695c99ac08387362aeed46619729ccfbe870045.tar.gz |
Only download .rpm once during installation.
-rw-r--r-- | .SRCINFO | 2 | ||||
-rwxr-xr-x | getnessus.sh | 29 |
2 files changed, 18 insertions, 13 deletions
@@ -1,5 +1,5 @@ # Generated by mksrcinfo v8 -# Fri May 20 14:23:55 UTC 2016 +# Wed Jul 6 21:41:20 UTC 2016 pkgbase = nessus pkgdesc = Vulnerability scanner pkgver = 6.7.0 diff --git a/getnessus.sh b/getnessus.sh index 73f5cdef1642..5d3804828231 100755 --- a/getnessus.sh +++ b/getnessus.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Created by vendforce for the Matthew Woelk in the arch AUR +# 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 @@ -26,17 +26,22 @@ RELEASE=6.7.0 echo -e "Downloading Nessus $RELEASE from downloads.nessus.org ... " -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 +for FEDORA in {0..9}; do + + if [ -f Nessus-$RELEASE-fc2$FEDORA.x86_64.rpm ] ; then + echo -e "Local file already exists for Nessus $RELEASE. No need to re-download it." + continue + fi + + 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 echo -e "... Download script has finished." |