diff options
| author | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-12-22 15:59:17 +0100 |
|---|---|---|
| committer | ivan-boikov <ik.boikov.public@protonmail.com> | 2024-12-22 15:59:17 +0100 |
| commit | e4b38bac467d969e92a0e9609ea6f5761ce1b66e (patch) | |
| tree | 29bd70f256a9669f3904e714d6f91c8eb9b403a1 /components/vpn.c | |
| parent | 5d3b72f391a26582b7c296817118a186e6e13da2 (diff) | |
VPN path
Diffstat (limited to 'components/vpn.c')
| -rw-r--r-- | components/vpn.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/components/vpn.c b/components/vpn.c index e5439fb..4d230e1 100644 --- a/components/vpn.c +++ b/components/vpn.c @@ -1,18 +1,16 @@ /* See LICENSE file for copyright and license details. */ #include <stdint.h> -#include <stdio.h> -#include <string.h> +#include <unistd.h> #include "../slstatus.h" #include "../util.h" const char * -vpn_status(const char *unused) +vpn_status(const char *path) { - char state[32]; - - if (pscanf("/sys/class/net/tun0/operstate", "%s", state) != 1) + if (access(path, F_OK) == 0) { + return bprintf(""); + } else { return bprintf(""); - - return bprintf(""); + } } |
