UFW app profile written in pure rust.
toml
ufwprofile = "" #check latest version above
Or
cargo add ufwprofile
```rust if ufwprofile::config::UFWConf::checkwritepermission() { //checks if ufw exists and the path /etc/ufw/applications.d is writable let mut x = ufwprofile::config::UFWConf::default(); x.appendports("80", "") .appendports("81:82", "tcp") .appendports("84", "udp") .appendports("83", "") .append_ports("8000", "tcp") .init("AppName", "Title", "Description").unwrap();
if ufwprofile::config::UFWConf::is_root() {// check if the app has root permission.
println!("{}",x.try_adding_to_ufw(true).unwrap());
}else{
println!("{}", x.try_adding_to_ufw_with_sudo(true).unwrap());
}
}
// alternatively you can call x.try_write() which just writes the file // at /etc/ufw/applications.d and not enable/disable the profile.
```
/etc/ufw/applications.d
check CHANGELOG.md