Debian Codegraph @

libexec/version

raw
1 #!/bin/sh
2
3 # Linux Vulnerability Mitigation
4 # Copyright (C) 2026 Daniel Baumann <[email protected]>
5 #
6 # SPDX-License-Identifier: PD
7 #
8 # This program is free software: you have unlimited permission
9 # to copy, distribute and modify it.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
15 set -e
16
17 PROGRAM="linux-vulnerability-mitigation"
18 COMMAND="$(basename "${0}")"
19
20 SHARE="/usr/share/${PROGRAM}"
21
22 Parameters ()
23 {
24 GETOPT_LONGOPTIONS="help,"
25 GETOPT_OPTIONS="h,"
26
27 PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name="${COMMAND}" --options ${GETOPT_OPTIONS} --shell sh -- "${@}")"
28
29 # shellcheck disable=SC2181
30 if [ "${?}" != "0" ]
31 then
32 echo "'${COMMAND}': getopt exit" >&2
33 exit 1
34 fi
35
36 eval set -- "${PARAMETERS}"
37
38 while true
39 do
40 case "${1}" in
41 -h|--help)
42 Usage
43 ;;
44
45 --)
46 shift 1
47 break
48 ;;
49
50 *)
51 echo "'${COMMAND}': getopt error" >&2
52 exit 1
53 ;;
54 esac
55 done
56 }
57
58 Usage ()
59 {
60 echo "Usage: ${PROGRAM} ${COMMAND} [-h|--help]" >&2
61 echo
62 echo "See ${PROGRAM}-${COMMAND}(1), ${PROGRAM}(1) and ${PROGRAM}(7) for more information."
63 }
64
65 Parameters "${@}"
66
67 # Run
68 cat "${SHARE}/VERSION.txt"