diff --git a/src/filesystem/mod.rs b/src/filesystem/mod.rs index c04de72..541fb16 100644 --- a/src/filesystem/mod.rs +++ b/src/filesystem/mod.rs @@ -1,2 +1,3 @@ pub mod mount; pub mod mounted; +pub mod credentials; diff --git a/src/main.rs b/src/main.rs index fa8ca02..ba680e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use crate::config::get_config; +use crate::filesystem::credentials::save_credentials_webdav; use crate::filesystem::mount::{mount, unmount}; use crate::filesystem::mounted::{is_mounted, is_mounted_as}; use crate::log::log; @@ -154,8 +155,12 @@ fn mount_remote() { unmount(mount_point); } + if mount_type == "davfs" || mount_type == "webdav" { + save_credentials_webdav(); + } + log("main", "Mounting remote filesystem...", LogLevel::Info); - mount(mount_point, &*format!("{}:{}@{}", get_config().remote.username, get_config().remote.password, get_config().remote.mount_path), mount_type); + mount(mount_point, &*get_config().remote.mount_path, mount_type); } } else { log("main", "Remote server not reachable.", LogLevel::Warn);