Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Illyse
Flash Openwrt Mikrotik Rb952ui 5ac2nD
Commits
67211a93
Commit
67211a93
authored
Mar 14, 2021
by
Félix Sipma
Browse files
modification commande sed
parent
795237ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
flash_openwrt_mikrotik_rb952ui-5ac2nD.py
View file @
67211a93
...
...
@@ -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 -E 's/.*software-id: ([[:alnum:]-]+).*/
\\
1/'.key"
,
shell
=
True
)
byteskey
=
subprocess
.
check_output
(
"ssh "
+
SSH_OPT
+
" admin@"
+
IP_ROUTEROS
+
"
\"
/system license print
\"
| grep
\"
software-id:
\"
|
head |
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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment