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

23 lines
467 B
Python

import sys
import process_known_hosts
import write_file
def main():
# TODO: Don't hardcode
# TODO: Handle errors
# TODO: Add a switch for whether you want to include IPs
with open(sys.argv[1], 'r') as f:
try:
entries = process_known_hosts.process_file(f)
except Exception as err:
print('Error: %s' % err, file=sys.stderr)
sys.exit(1)
with open('known_hosts.sshwot', 'wb') as f:
write_file.write(f, entries)
if __name__ == '__main__':
main()