mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
24 lines
554 B
Rust
24 lines
554 B
Rust
use is_executable::IsExecutable;
|
|
use std::path::Path;
|
|
|
|
const VPNC_SCRIPT_LOCATIONS: [&str; 5] = [
|
|
"/usr/local/share/vpnc-scripts/vpnc-script",
|
|
"/usr/local/sbin/vpnc-script",
|
|
"/usr/share/vpnc-scripts/vpnc-script",
|
|
"/usr/sbin/vpnc-script",
|
|
"/etc/vpnc/vpnc-script",
|
|
];
|
|
|
|
pub(crate) fn find_default_vpnc_script() -> Option<String> {
|
|
for location in VPNC_SCRIPT_LOCATIONS.iter() {
|
|
let path = Path::new(location);
|
|
if path.is_executable() {
|
|
return Some(location.to_string());
|
|
}
|
|
}
|
|
|
|
log::warn!("vpnc-script not found");
|
|
|
|
None
|
|
}
|