agent: invert autoCheckUpdates

This commit is contained in:
Aiden McClelland
2021-01-20 13:38:39 -07:00
committed by Aiden McClelland
parent df05fade25
commit 7417bfdbfa
2 changed files with 5 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ getServerR = handleS9ErrT $ do
wifi <- WpaSupplicant.runWlan0 $ liftA2 WifiList WpaSupplicant.getCurrentNetwork WpaSupplicant.listNetworks wifi <- WpaSupplicant.runWlan0 $ liftA2 WifiList WpaSupplicant.getCurrentNetwork WpaSupplicant.listNetworks
specs <- getSpecs settings specs <- getSpecs settings
welcomeAck <- fmap isJust . lift . runDB . Persist.get $ WelcomeAckKey agentVersion welcomeAck <- fmap isJust . lift . runDB . Persist.get $ WelcomeAckKey agentVersion
autoCheckUpdates <- runM $ injectFilesystemBaseFromContext settings $ existsSystemPath autoCheckUpdatesPath autoCheckUpdates <- runM $ injectFilesystemBaseFromContext settings $ fmap not (existsSystemPath disableAutoCheckUpdatesPath)
let sid = T.drop 7 $ specsNetworkId specs let sid = T.drop 7 $ specsNetworkId specs
@@ -125,8 +125,8 @@ patchAutoCheckUpdatesR = do
settings <- getsYesod appSettings settings <- getsYesod appSettings
BoolPatchReq val <- requireCheckJsonBody BoolPatchReq val <- requireCheckJsonBody
runM $ injectFilesystemBaseFromContext settings $ if val runM $ injectFilesystemBaseFromContext settings $ if val
then writeSystemPath autoCheckUpdatesPath "" then deleteSystemPath disableAutoCheckUpdatesPath
else deleteSystemPath autoCheckUpdatesPath else writeSystemPath disableAutoCheckUpdatesPath ""
patchFile :: SystemPath -> Handler () patchFile :: SystemPath -> Handler ()
patchFile path = do patchFile path = do

View File

@@ -193,8 +193,8 @@ agentTorHiddenServicePrivateKeyPath = agentTorHiddenServiceDirectory <> "/hs_ed2
serverNamePath :: SystemPath serverNamePath :: SystemPath
serverNamePath = "/root/agent/name.txt" serverNamePath = "/root/agent/name.txt"
autoCheckUpdatesPath :: SystemPath disableAutoCheckUpdatesPath :: SystemPath
autoCheckUpdatesPath = "/root/agent/.autoCheckUpdates" disableAutoCheckUpdatesPath = "/root/agent/.disableAutoCheckUpdates"
altRegistryUrlPath :: SystemPath altRegistryUrlPath :: SystemPath
altRegistryUrlPath = "/root/agent/alt_registry_url.txt" altRegistryUrlPath = "/root/agent/alt_registry_url.txt"