diff options
author | joe <joe@jerkface.net> | 2016-04-26 04:41:51 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2016-04-26 04:41:51 -0400 |
commit | 4060aa72904d77a13afad303a220d526e0ba7378 (patch) | |
tree | e48a8f99f760b8756647d6ba01930ddfe97b5571 /lib | |
parent | 30a948ff8dd9f60e6a860d38c3ec76728f8dcbdb (diff) |
clear cache before refresh.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kiki.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 6717c4b..333369f 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs | |||
@@ -19,6 +19,7 @@ import System.Directory | |||
19 | import System.FilePath.Posix | 19 | import System.FilePath.Posix |
20 | import System.IO | 20 | import System.IO |
21 | import System.Posix.User | 21 | import System.Posix.User |
22 | import System.Process | ||
22 | import qualified Codec.Binary.Base64 as Base64 | 23 | import qualified Codec.Binary.Base64 as Base64 |
23 | import qualified Data.ByteString.Lazy as L | 24 | import qualified Data.ByteString.Lazy as L |
24 | import qualified Data.ByteString.Lazy.Char8 as Char8 | 25 | import qualified Data.ByteString.Lazy.Char8 as Char8 |
@@ -230,6 +231,8 @@ refreshCache rt rootdir = do | |||
230 | -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" | 231 | -- sshspathpub0 = fromMaybe "" rootdir ++ "/etc/ssh/ssh_host_rsa_key.pub" |
231 | -- contactipsec0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/certs/%(onion).pem" | 232 | -- contactipsec0 = fromMaybe "" rootdir ++ "/etc/ipsec.d/certs/%(onion).pem" |
232 | 233 | ||
234 | callCommand ("rm -rf "++ mkpath "*") -- clean up, in case gpg altered the keyring. | ||
235 | |||
233 | -- Finally, export public keys if they do not exist. | 236 | -- Finally, export public keys if they do not exist. |
234 | flip (maybe $ warn "missing working key?") (rtGrip rt) $ \grip -> do | 237 | flip (maybe $ warn "missing working key?") (rtGrip rt) $ \grip -> do |
235 | either warn (write $ mkpath "root/.ssh/id_rsa.pub") | 238 | either warn (write $ mkpath "root/.ssh/id_rsa.pub") |