diff --git a/tg_server/tg_server.lua b/tg_server/tg_server.lua index 313c647..8e93d62 100644 --- a/tg_server/tg_server.lua +++ b/tg_server/tg_server.lua @@ -112,15 +112,17 @@ elseif args[1] == "add_card" then local new_card = args[2] local new_card_parts = split(new_card, ',') local card_holder = new_card_parts[1] + local card_hash = hash(new_card) - local key_file = fs.open(card_holder..'.key', 'w') + local key_file = fs.open(card_hash..'.key', 'w') key_file.write(new_card) key_file.close() local trusted_keys = fs.open(dir..config.key_file, 'a') - local card_hash = hash(new_card) trusted_keys.write(card_hash) trusted_keys.close() + + print("Created key "..card_hash..".key in root dir") end elseif args[1] == "remove_card" then if args[2] then