summaryrefslogtreecommitdiff
path: root/Property/Tor.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Property/Tor.hs')
-rw-r--r--Property/Tor.hs21
1 files changed, 9 insertions, 12 deletions
diff --git a/Property/Tor.hs b/Property/Tor.hs
index bebf0763..b26ba68e 100644
--- a/Property/Tor.hs
+++ b/Property/Tor.hs
@@ -1,21 +1,18 @@
module Property.Tor where
-import Control.Applicative
-import Control.Monad
-import System.FilePath
-
import Property
-import Property.User
import Utility.SafeCommand
-import Utility.Exception
+import qualified Property.Apt as Apt
isBridge :: Property
-isBridge = fileHasContent "/etc/tor/torrc"
- [ "SocksPort 0"
- , "ORPort 443"
- , "BridgeRelay 1"
- , "Exitpolicy reject *:*"
- ] `onChange` restartTor
+isBridge = setup `requires` Apt.installed ["tor"]
+ where
+ setup = fileHasContent "/etc/tor/torrc"
+ [ "SocksPort 0"
+ , "ORPort 443"
+ , "BridgeRelay 1"
+ , "Exitpolicy reject *:*"
+ ] `onChange` restartTor
restartTor :: Property
restartTor = cmdProperty "service" [Param "tor", Param "restart"]