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
|
2018-08-29 11:58:56 +00:00
|
|
|
# TODO: Add a switch for whether you want to include IPs
|
2018-08-28 09:27:54 +00:00
|
|
|
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()
|
|
|
|
|