From bcf03d8c7aa88dc5ac6355e93b1168daee338bb6 Mon Sep 17 00:00:00 2001 From: joe Date: Tue, 26 Apr 2016 15:37:32 -0400 Subject: cokiki requires root for everything for now. --- cokiki.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'cokiki.hs') diff --git a/cokiki.hs b/cokiki.hs index c93e30e..fb0523c 100644 --- a/cokiki.hs +++ b/cokiki.hs @@ -52,9 +52,9 @@ main = do | uid==0 = action | otherwise = hPutStrLn stderr "operation requires root." let sel = case cmd of - ["ssh-client"] -> pure (sshClient uid) <*> Kiki.ㄧchroot <*> Kiki.ㄧhomedir - ["ssh-server"] -> pure (whenRoot sshServer) - ["strongswan"] -> pure (whenRoot strongswan) + ["ssh-client"] -> fmap whenRoot $ sshClient uid <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir + ["ssh-server"] -> fmap whenRoot $ sshServer <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir + ["strongswan"] -> fmap whenRoot $ strongswan <$> Kiki.ㄧchroot <*> Kiki.ㄧhomedir _ -> pure $ hPutStr stderr usage spec = uncurry fancy Kiki.kikiOptions "" case runArgs (parseInvocation spec args) sel of @@ -97,14 +97,14 @@ sshClient uid root cmn = do -- Kiki.replaceSshServerKeys root cmn Kiki.importAndRefresh root cmn -sshServer = do +sshServer root cmn = do -- /etc/ssh/sshd_config <-- 'HostKey /var/cache/kiki/ssh_host_ecdsa_key' etc. - return () + Kiki.importAndRefresh root cmn -strongswan = do +strongswan root cmn = do -- etc/ipsec.conf <-- 'include /var/cache/kiki/ipsec.conf' -- /root/.gnupg/... <-- contains newly-generated ipsec subkey - Kiki.refresh id (Kiki.CommonArgsParsed Nothing Nothing) + Kiki.importAndRefresh root cmn -- /var/cache/kiki/ipsec.conf <-- contains configurations for each remote ipsec host -- /var/cache/kiki/ipsec.conf <-- contains '%default' configuration for this local host -- /var/cache/kiki/ipsec.d/certs <-- contains relevant certs -- cgit v1.2.3