From: Thomas Glanzmann Date: Fri, 4 Mar 2022 18:42:20 +0000 (+0100) Subject: add a sanity check that checks if it runs as root X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/m1-debian/commitdiff_plain/b403cd99fa4f5f00c109d783524fc7d503e3fced?hp=d4539a8ac74b8f80fffb726214ec18d8dddb7f69 add a sanity check that checks if it runs as root --- diff --git a/m1di.pl b/m1di.pl index c46e7bb..1d86c68 100644 --- a/m1di.pl +++ b/m1di.pl @@ -38,6 +38,8 @@ find_identifier_before_free_space return ($identifier, $size); } +die "This script must be run as root\n" if ($< != 0); + ($identifier, $size) = find_identifier_before_free_space(); system("diskutil addPartition $identifier %EFI% LB 512MB");