Skip to content

Commit dda72dd

Browse files
1Naimptr1337
authored andcommitted
sbctl-batch-sign: Remove unnecessary root check
We're already checking if the user isn't root before the main body of the script, so there is no need to wrap it again with a check if the user is root Signed-off-by: Eric Naim <dnaim@cachyos.org>
1 parent 4d14455 commit dda72dd

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

usr/bin/sbctl-batch-sign

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@ if [ "$(id -u)" -ne 0 ]; then
1515
exit 1
1616
fi
1717

18-
if [ "$#" -eq 0 ]; then
19-
export ESP_PATH=/boot
20-
21-
sbctl verify 2>/dev/null | awk '/✗/ {print $2}' | while IFS= read -r entry; do
22-
# We expect users who use this script to enroll their
23-
# own keys alongside Microsoft's.
24-
# With that in mind, there's no need to sign MS ESP
25-
# files with our own keys.
26-
if [[ "$entry" =~ ^.*/EFI/(Microsoft|Windows) || "$entry" == *.mui || "$entry" == *.dll
27-
|| "$entry" =~ ^/boot/grub ]]; then
28-
continue
29-
fi
30-
sbctl sign -s "$entry"
31-
done
32-
fi
18+
export ESP_PATH=/boot
19+
sbctl verify 2>/dev/null | awk '/✗/ {print $2}' | while IFS= read -r entry; do
20+
# We expect users who use this script to enroll their
21+
# own keys alongside Microsoft's.
22+
# With that in mind, there's no need to sign MS ESP
23+
# files with our own keys.
24+
if [[ "$entry" =~ ^.*/EFI/(Microsoft|Windows) || "$entry" == *.mui || "$entry" == *.dll
25+
|| "$entry" =~ ^/boot/grub ]]; then
26+
continue
27+
fi
28+
sbctl sign -s "$entry"
29+
done

0 commit comments

Comments
 (0)