summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-27 13:09:30 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-27 13:09:30 -0400
commit8fe65bd0f70c1cd2fc83469f401c987d69eb4370 (patch)
tree6e37cd1050f7b0b8d59b4198f6843c3faa54dbb9 /CmdLine.hs
parentd154002e063c1c3af5aba13cf05a11df8b8f9897 (diff)
downloadkeysafe-8fe65bd0f70c1cd2fc83469f401c987d69eb4370.tar.gz
Added --check-servers mode, which is useful both at the command line to see what servers keysafe knows about, and as a cron job.
This commit was sponsored by Jake Vosloo on Patreon.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 6c5bafd..702c97d 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -31,7 +31,7 @@ data CmdLine = CmdLine
, chaffMaxDelay :: Maybe Seconds
}
-data Mode = Backup | Restore | UploadQueued | AutoStart | Server | BackupServer FilePath | RestoreServer FilePath | Chaff HostName | Benchmark | Test
+data Mode = Backup | Restore | UploadQueued | AutoStart | Server | BackupServer FilePath | RestoreServer FilePath | Chaff HostName | CheckServers | Benchmark | Test
deriving (Show)
data ServerConfig = ServerConfig
@@ -135,6 +135,10 @@ parseMode =
<> metavar "HOSTNAME"
<> help "Upload random data to a keysafe server."
)
+ <|> flag' CheckServers
+ ( long "check-servers"
+ <> help "Tries to connect to each server in the server list. Displays the server's MOTD, and the amount of data stored on it. Prints message to stderr and exits nonzero if any of the servers are not accessible."
+ )
<|> flag' Benchmark
( long "benchmark"
<> help "Benchmark speed of keysafe's cryptographic primitives."