From e812acce3e46b7dd259783fc28c2c65d4ad7a228 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Mar 2014 00:52:02 -0400 Subject: improvements --- Property/Tor.hs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'Property/Tor.hs') 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"] -- cgit v1.2.3