diff options
-rwxr-xr-x | share/hydractl/obsolete-packages | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/share/hydractl/obsolete-packages b/share/hydractl/obsolete-packages index 1b84ff5..783d2b8 100755 --- a/share/hydractl/obsolete-packages +++ b/share/hydractl/obsolete-packages @@ -16,16 +16,37 @@ # License along with this program. If not, see # <http://www.gnu.org/licenses/>. +# Parameters OBSOLETE="`apt-show-versions | grep 'No available version' | cut -d : -f 1`" +# List all obsolete packages if [ ! -z "$OBSOLETE" ]; then - echo "Obsolete packages: $OBSOLETE" + echo "Obsolete packages:" + echo "" + + if echo "$*" | grep -q -- 'xargs'; then + echo "$OBSOLETE" | xargs + else + echo "$OBSOLETE" + fi fi +# List all obsolete packages with known vulnerabilities if which debsecan &> /dev/null; then VULNS="`debsecan | grep obsolete | cut -d ' ' -f 2 | uniq`" + if [ ! -z "$OBSOLETE" ]; then + echo "" + fi + if [ ! -z "$VULNS" ]; then - echo "Obsolete packages with known vulnerabilities: $VULNS" + echo "Obsolete packages with known vulnerabilities:" + echo "" + + if echo "$*" | grep -q -- 'xargs'; then + echo "$VULNS" | xargs + else + echo "$VULNS" + fi fi fi |