+ readInputLine' "Which zone do you want to edit (or create?): "
+ soa <- getZone db zone
+ ns <- let d = fromMaybe (read $ "ns." ++ show zone) $ fmap soaMasterNameServer soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("Which host is the master name server? (default: " ++ show d ++ "): ")
+ d
+ mail <- let d = fromMaybe (read $ "root." ++ show ns) $ fmap soaResponsibleMailbox soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("Which is the mailbox of responsibility? (default: " ++ show d ++ "): ")
+ d
+ refr <- let d = fromIntegral $ fromMaybe 3600 $ fmap soaRefreshInterval soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("How many seconds should refresh interval be? (default: " ++ show d ++ "): ")
+ d
+ retr <- let d = fromIntegral $ fromMaybe 900 $ fmap soaRetryInterval soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("How many seconds should retry interval be? (default: " ++ show d ++ "): ")
+ d
+ expi <- let d = fromIntegral $ fromMaybe 604800 $ fmap soaExpirationLimit soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("How many seconds should expiration limit be? (default: " ++ show d ++ "): ")
+ d
+ mint <- let d = fromIntegral $ fromMaybe 3600 $ fmap soaExpirationLimit soa
+ in runInputT defaultSettings $
+ readInputLineWithDefault
+ ("How many seconds should minimum TTL be? (default: " ++ show d ++ "): ")
+ d
+ let soa' = SOAFields {
+ soaMasterNameServer = ns
+ , soaResponsibleMailbox = mail
+ , soaSerialNumber = fromMaybe 0 $ fmap ((+1) . soaSerialNumber) soa
+ , soaRefreshInterval = refr
+ , soaRetryInterval = retr
+ , soaExpirationLimit = expi
+ , soaMinimumTTL = mint
+ }
+ putZone db zone soa'