sshwot/src/main-export-known-hosts.py

22 lines
409 B
Python
Raw Normal View History

2018-08-28 09:27:54 +00:00
import sys
import process_known_hosts
import write_file
def main():
# TODO: Don't hardcode
# TODO: Handle errors
with open(sys.argv[1], 'r') as f:
2018-08-29 11:04:07 +00:00
try:
entries = process_known_hosts.process_file(f)
except Exception as err:
print('Error: %s' % err, file=sys.stderr)
sys.exit(1)
2018-08-28 09:27:54 +00:00
with open('known_hosts.sshwot', 'wb') as f:
write_file.write(f, entries)
if __name__ == '__main__':
main()