Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
06f860c8
Unverified
Commit
06f860c8
authored
Jun 19, 2019
by
neil
Committed by
GitHub
Jun 19, 2019
Browse files
Merge pull request #2292 from cngarrison/master
change to routeros native script rather than bash multiline commands
parents
24e574ee
c42dbbfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy/routeros.sh
View file @
06f860c8
...
...
@@ -85,30 +85,27 @@ routeros_deploy() {
scp
"
$_ckey
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.key"
_info
"Trying to push cert '
$_cfullchain
' to router"
scp
"
$_cfullchain
"
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
:
$_cdomain
.cer"
DEPLOY_SCRIPT_CMD
=
"/system script add name=
\"
LE Cert Deploy -
$_cdomain
\"
owner=admin policy=ftp,read,write,password,sensitive
source=
\"
## generated by routeros deploy script in acme.sh
\n
/certificate remove [ find name=
$_cdomain
.cer_0 ]
\n
/certificate remove [ find name=
$_cdomain
.cer_1 ]
\n
delay 1
\n
/certificate import file-name=
$_cdomain
.cer passphrase=
\\\"\\\"
\n
/certificate import file-name=
$_cdomain
.key passphrase=
\\\"\\\"
\n
delay 1
\n
/file remove
$_cdomain
.cer
\n
/file remove
$_cdomain
.key
\n
delay 2
\n
/ip service set www-ssl certificate=
$_cdomain
.cer_0
\n
$ROUTER_OS_ADDITIONAL_SERVICES
\n\"
"
# shellcheck disable=SC2029
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
bash
-c
"'
/certificate remove
$_cdomain
.cer_0
/certificate remove
$_cdomain
.cer_1
delay 1
/certificate import file-name=
$_cdomain
.cer passphrase=
\"\"
/certificate import file-name=
$_cdomain
.key passphrase=
\"\"
delay 1
/file remove
$_cdomain
.cer
/file remove
$_cdomain
.key
delay 2
/ip service set www-ssl certificate=
$_cdomain
.cer_0
$ROUTER_OS_ADDITIONAL_SERVICES
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"
$DEPLOY_SCRIPT_CMD
"
# shellcheck disable=SC2029
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"/system script run
\"
LE Cert Deploy -
$_cdomain
\"
"
# shellcheck disable=SC2029
ssh
"
$ROUTER_OS_USERNAME
@
$ROUTER_OS_HOST
"
"/system script remove
\"
LE Cert Deploy -
$_cdomain
\"
"
'"
return
0
}
Write
Preview
Markdown
is supported
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