summaryrefslogtreecommitdiff
path: root/pkg/snowflake/tor.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/snowflake/tor.go')
-rw-r--r--pkg/snowflake/tor.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkg/snowflake/tor.go b/pkg/snowflake/tor.go
new file mode 100644
index 0000000..4f4c4e4
--- /dev/null
+++ b/pkg/snowflake/tor.go
@@ -0,0 +1,15 @@
+package snowflake
+
+import (
+ "errors"
+ "os"
+)
+
+func exists(path string) bool {
+ _, err := os.Stat(path)
+ return !errors.Is(err, os.ErrNotExist)
+}
+
+func HasTor() bool {
+ return exists("/usr/sbin/tor")
+}