From e9b48b71a8bafc585cdc889ee78b9a80e92038a0 Mon Sep 17 00:00:00 2001 From: Bandie Date: Sun, 8 Apr 2018 14:46:43 +0200 Subject: [PATCH] Fixing exit code error --- sbin/grub2-unsign | 12 ++++++++---- sbin/grub2-verify | 12 ++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sbin/grub2-unsign b/sbin/grub2-unsign index 15b1064..bb6de2f 100755 --- a/sbin/grub2-unsign +++ b/sbin/grub2-unsign @@ -18,13 +18,17 @@ then elif (( $stat == 3 )) then printf 'Ignoring missing signatures...\n' +elif (( $stat == 0 )) +then + # Then remove the signatures. + find /boot -name '*.sig' -exec rm -- '{}' + + + echo "GRUB2 unsigned. WARNING: If you want to deactivate GRUB2's signature feature, change the check_signatures variable in the headers file!" + exit 0 + else printf 'Something unknown happened!\n' exit 99 fi -# Then remove the signatures. -find /boot -name '*.sig' -exec rm -- '{}' + -echo "GRUB2 unsigned. WARNING: If you want to deactivate GRUB2's signature feature, change the check_signatures variable in the headers file!" -exit 0 diff --git a/sbin/grub2-verify b/sbin/grub2-verify index 265464e..0eb006c 100755 --- a/sbin/grub2-verify +++ b/sbin/grub2-verify @@ -87,11 +87,11 @@ fi if (( ${#error_files[@]} > 0 )) then exit 1 -elif (( ${#missing_files[@]} > 0 )) -then - exit 3 -else - exit 0 fi -exit 99 +if (( ${#missing_files[@]} > 0 )) +then + exit 3 +fi + +exit 0