diff options
-rwxr-xr-x | spectre-meltdown-checker.sh | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index 013e718..3186c4e 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -1,7 +1,7 @@ #! /bin/sh # Spectre & Meltdown checker # Stephane Lesimple -VERSION=0.10 +VERSION=0.11 # print status function pstatus() @@ -78,9 +78,18 @@ extract_vmlinux() # end of extract-vmlinux functions -/bin/echo "Spectre and Meltdown mitigation detection tool v$VERSION" +/bin/echo -e "\033[1;34mSpectre and Meltdown mitigation detection tool v$VERSION\033[0m" /bin/echo +# root check + +if [ "$(id -u)" -ne 0 ]; then + /bin/echo -e "\033[31mNote that you should launch this script with root privileges to get accurate information." + /bin/echo -e "\033[31mWe'll proceed but you might see permission denied errors." + /bin/echo -e "\033[31mTo run it as root, you can try the following command: sudo $0" + /bin/echo +fi + ########### # SPECTRE 1 /bin/echo -e "\033[1;34mCVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'\033[0m" @@ -93,6 +102,7 @@ img='' [ -e /boot/vmlinuz-$(uname -r) ] && img=/boot/vmlinuz-$(uname -r) [ -e /boot/kernel-$( uname -r) ] && img=/boot/kernel-$( uname -r) [ -e /boot/bzImage-$(uname -r) ] && img=/boot/bzImage-$(uname -r) +[ -e /boot/kernel-genkernel-$(uname -m)-$(uname -r) ] && img=/boot/kernel-genkernel-$(uname -m)-$(uname -r) if [ -z "$img" ]; then pstatus yellow UNKNOWN "couldn't find your kernel image in /boot, if you used netboot, this is normal" else @@ -295,9 +305,5 @@ else fi /bin/echo -if [ "$(id -u)" -ne 0 ]; then - /bin/echo "Note that you should launch this script with root privileges to get accurate information" - /bin/echo "You can try the following command: sudo $0" -fi [ -n "$vmlinux" -a -f "$vmlinux" ] && rm -f "$vmlinux" |