Commit 795237ee authored by Félix Sipma's avatar Félix Sipma
Browse files

Utilisation de "sed -E" au lieu de "sed -r"

parent 7e92f324
......@@ -56,7 +56,7 @@ except:
print(BLUE + "Copie de la clé de licence depuis le routeur" + NC)
try:
subprocess.run("ssh " + SSH_OPT + " admin@" + IP_ROUTEROS + " \"/system license output\"", shell=True)
byteskey = subprocess.check_output("ssh " + SSH_OPT + " admin@" + IP_ROUTEROS + " \"/system license print\" | grep \"software-id:\" | sed -r 's/.*software-id: ([[:alnum:]-]+).*/\\1/'.key", shell=True)
byteskey = subprocess.check_output("ssh " + SSH_OPT + " admin@" + IP_ROUTEROS + " \"/system license print\" | grep \"software-id:\" | sed -E 's/.*software-id: ([[:alnum:]-]+).*/\\1/'.key", shell=True)
# ^ TODO: verify if "byteskey" right is the right output
key = byteskey.decode('utf-8') + ".key"
subprocess.run("scp " + SSH_OPT + " admin@" + IP_ROUTEROS + ":/" + key + "./" + key, shell=True)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment