From 979213d5524f9b39991f34b16babe925abe86666 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Tue, 8 Oct 2024 16:56:57 +0200 Subject: add systemd service --- src/storage.rs | 3 ++- webol.service | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 webol.service diff --git a/src/storage.rs b/src/storage.rs index e069875..05a4a5d 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -30,7 +30,8 @@ impl Device { trace!("check for storage STORAGE_PATH=\"{}\"", Self::STORAGE_PATH); let sp = Path::new(Self::STORAGE_PATH); if !sp.exists() { - warn!("device storage path doesn't exist, creating it"); + let current_dir = std::env::current_dir()?; + warn!(?current_dir, "device storage path doesn't exist, creating it"); create_dir_all(Self::STORAGE_PATH)?; }; diff --git a/webol.service b/webol.service new file mode 100644 index 0000000..9e23b90 --- /dev/null +++ b/webol.service @@ -0,0 +1,7 @@ +[Unit] +Description=Webol: WakeOnLan through Wireguard Tunnel +After=network.target + +[Service] +ExecStart=/usr/local/bin/webol +WorkingDirectory=/usr/local/share/webol -- cgit v1.2.3