#!/bin/sh # Linux Vulnerability Mitigation # Copyright (C) 2026 Daniel Baumann # # SPDX-License-Identifier: PD # # This program is free software: you have unlimited permission # to copy, distribute and modify it. # # This program 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. set -e PROGRAM="linux-vulnerability-mitigation" COMMAND="$(basename "${0}")" SHARE="/usr/share/${PROGRAM}" if [ -t 1 ] && [ -t 2 ] then WHITE="\033[1;33;37m" NORMAL="\033[0m" fi Parameters () { GETOPT_LONGOPTIONS="help," GETOPT_OPTIONS="h," PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name="${COMMAND}" --options ${GETOPT_OPTIONS} --shell sh -- "${@}")" # shellcheck disable=SC2181 if [ "${?}" != "0" ] then echo "'${COMMAND}': getopt exit" >&2 exit 1 fi eval set -- "${PARAMETERS}" while true do case "${1}" in -h|--help) Usage ;; --) shift 1 break ;; *) echo "'${COMMAND}': getopt error" >&2 exit 1 ;; esac done } Usage () { echo "Usage: ${PROGRAM} ${COMMAND} [-h|--help]" >&2 echo echo "See ${PROGRAM}-${COMMAND}(1), ${PROGRAM}(1) and ${PROGRAM}(7) for more information." } Parameters "${@}" # Run MITIGATIONS="$(find "${SHARE}/mitigations" -mindepth 1 -printf '%f\n' | sort -V)" for MITIGATION in ${MITIGATIONS} do echo " ${WHITE}available ${NORMAL} ${MITIGATION} $(awk -F= '/^DATE=/ { print $2 }' "${SHARE}/mitigations/${MITIGATION}") $(awk -F= '/^NAME=/ { print $2 }' "${SHARE}/mitigations/${MITIGATION}")" done