diff options
author | fxqnlr <[email protected]> | 2024-10-08 16:56:57 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-10-08 16:56:57 +0200 |
commit | 979213d5524f9b39991f34b16babe925abe86666 (patch) | |
tree | fd2ddb0c42346d23a6797e332191e60de0bac431 | |
parent | 7740bf12633a3c7c2e461aa8b74c852efbb9318b (diff) | |
download | webol-systemd.tar webol-systemd.tar.gz webol-systemd.zip |
add systemd servicesystemd
-rw-r--r-- | src/storage.rs | 3 | ||||
-rw-r--r-- | webol.service | 7 |
2 files changed, 9 insertions, 1 deletions
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 { | |||
30 | trace!("check for storage STORAGE_PATH=\"{}\"", Self::STORAGE_PATH); | 30 | trace!("check for storage STORAGE_PATH=\"{}\"", Self::STORAGE_PATH); |
31 | let sp = Path::new(Self::STORAGE_PATH); | 31 | let sp = Path::new(Self::STORAGE_PATH); |
32 | if !sp.exists() { | 32 | if !sp.exists() { |
33 | warn!("device storage path doesn't exist, creating it"); | 33 | let current_dir = std::env::current_dir()?; |
34 | warn!(?current_dir, "device storage path doesn't exist, creating it"); | ||
34 | create_dir_all(Self::STORAGE_PATH)?; | 35 | create_dir_all(Self::STORAGE_PATH)?; |
35 | }; | 36 | }; |
36 | 37 | ||
diff --git a/webol.service b/webol.service new file mode 100644 index 0000000..9e23b90 --- /dev/null +++ b/webol.service | |||
@@ -0,0 +1,7 @@ | |||
1 | [Unit] | ||
2 | Description=Webol: WakeOnLan through Wireguard Tunnel | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | ExecStart=/usr/local/bin/webol | ||
7 | WorkingDirectory=/usr/local/share/webol | ||