propellor spin
This commit is contained in:
parent
f89aeaa0e8
commit
31739ac1a6
|
@ -96,14 +96,12 @@ spin target relay hst = do
|
||||||
-- the host in it at all, use one of the Host's IPs instead.
|
-- the host in it at all, use one of the Host's IPs instead.
|
||||||
getSshTarget :: HostName -> Host -> IO String
|
getSshTarget :: HostName -> Host -> IO String
|
||||||
getSshTarget target hst
|
getSshTarget target hst
|
||||||
| null configips = go =<< tryIO (BSD.getHostByName target)
|
| null configips = return target
|
||||||
| otherwise = return target
|
| otherwise = go =<< tryIO (BSD.getHostByName target)
|
||||||
where
|
where
|
||||||
go (Left e) = useip (show e)
|
go (Left e) = useip (show e)
|
||||||
go (Right hostentry) = ifM (anyM matchingconfig (BSD.hostAddresses hostentry))
|
go (Right hostentry) = ifM (anyM matchingconfig (BSD.hostAddresses hostentry))
|
||||||
( do
|
( return target
|
||||||
print "MATCHING IP"
|
|
||||||
return target
|
|
||||||
, do
|
, do
|
||||||
ips <- mapM inet_ntoa (BSD.hostAddresses hostentry)
|
ips <- mapM inet_ntoa (BSD.hostAddresses hostentry)
|
||||||
useip ("DNS " ++ show ips ++ " vs configured " ++ show configips)
|
useip ("DNS " ++ show ips ++ " vs configured " ++ show configips)
|
||||||
|
|
Loading…
Reference in New Issue