diff --git a/bootpkg/src/main.rs b/bootpkg/src/main.rs index ffd4338..65037f3 100644 --- a/bootpkg/src/main.rs +++ b/bootpkg/src/main.rs @@ -15,6 +15,14 @@ mod args; mod prelude; fn main() { + #[cfg(not(debug_assertions))] + { + if unsafe { libc::getuid() } != 0 { + println!("bootpkg must be run as root."); + std::process::exit(1); + } + } + let args = Args::from(env::args().collect::>()[1..].to_owned()); match args.command { Command::Strap => {