fn safe_shutdown() {
  use runas::Command;
  
  //shutdown -h now
  let status = Command::new("shutdown")
	.arg("-h").arg("now")
	.status().expect("cmd failed!");

  if !status.success()  {
    println!("shutdown failed {}", status);
  }
  else {
    println!("shutdown");
  }
}
/// Shut down the system, entering HALT mode on raspberry pi
Shut down the system, entering HALT mode on raspberry pi
Shut down the system entering HALT mode on raspberry pi
fn safe_shutdown() {
  use runas::Command;
  //shutdown -h now
  let status = Command::new("shutdown")
	.arg("-h").arg("now")
	.status().expect("cmd failed!");
  if !status.success()  {
    println!("shutdown failed {}", status);
  }
  else {
    println!("shutdown");
  }
}
fn safe_shutdown ( ) { use runas :: Command ; //shutdown -h now let status = Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . status ( ) . expect ( " " ) ; if ! status . success ( ) { println ! ( " " status ) ; } else { println ! ( " " ) ; } }
Shut down the system, entering HALT mode on raspberry pi
Shut down the system entering HALT mode on raspberry pi