3fd4970a37886413cc8ecbd7cf8550be4465e0c4
[valheim_web.git] / backend / src / valheim_controller.rs
1 use sysinfo::{ ProcessExt, SystemExt };
2
3 pub fn is_valheim_running() -> bool {
4 let mut system = sysinfo::System::new_all();
5 system.refresh_all();
6 let process = system.get_process_by_name("valheim_server");
7
8 if process.len() >= 1 {
9 println!("Valheim running");
10 true
11 } else {
12 println!("Valheim not running");
13 false
14 }
15 }