propellor spin

This commit is contained in:
Joey Hess 2015-01-08 22:51:09 -04:00
parent c4a1e61d26
commit 0c66be1aae
Failed to extract signature
1 changed files with 8 additions and 2 deletions

View File

@ -112,8 +112,14 @@ getSshTarget target hst
useip why = case headMaybe configips of
Nothing -> return target
Just ip -> do
warningMessage $ "DNS seems out of date for " ++ target ++ " (" ++ why ++ "); using IP address from configuration instead."
return ip
-- If we're being asked to run on the local host,
-- ignore DNS.
s <- takeWhile (/= '\n') <$> readProcess "hostname" ["-f"]
if s == target
then return target
else do
warningMessage $ "DNS seems out of date for " ++ target ++ " (" ++ why ++ "); using IP address from configuration instead."
return ip
configips = map fromIPAddr $ mapMaybe getIPAddr $
S.toList $ _dns $ hostInfo hst