sshwot-export-known-hosts exports ~/.ssh/known_hosts by default
This commit is contained in:
parent
c1c8890319
commit
e6b3345421
|
@ -1,4 +1,5 @@
|
||||||
import argparse
|
import argparse
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import process_known_hosts
|
import process_known_hosts
|
||||||
|
@ -42,8 +43,16 @@ def main():
|
||||||
help = 'write the sshwot file to a given file instead of the stdout'
|
help = 'write the sshwot file to a given file instead of the stdout'
|
||||||
)
|
)
|
||||||
|
|
||||||
# The required argument
|
try:
|
||||||
|
homedir = os.environ['HOME']
|
||||||
|
except KeyError:
|
||||||
|
raise KeyError('$HOME is not set')
|
||||||
|
|
||||||
|
# The input file
|
||||||
|
# Default to ~/.ssh/known_hosts
|
||||||
parser.add_argument('infile',
|
parser.add_argument('infile',
|
||||||
|
nargs = '?',
|
||||||
|
default = homedir + '/.ssh/known_hosts',
|
||||||
help = 'a file in .ssh/known_hosts format'
|
help = 'a file in .ssh/known_hosts format'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue