reformatted RouterOS script for shfmt checks

This commit is contained in:
Charlie Garrison 2019-06-03 11:38:39 +10:00
parent 03a407d4df
commit c42dbbfec8

View File

@ -85,22 +85,23 @@ routeros_deploy() {
scp "$_ckey" "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST:$_cdomain.key" scp "$_ckey" "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST:$_cdomain.key"
_info "Trying to push cert '$_cfullchain' to router" _info "Trying to push cert '$_cfullchain' to router"
scp "$_cfullchain" "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST:$_cdomain.cer" scp "$_cfullchain" "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST:$_cdomain.cer"
# shellcheck disable=SC2029 DEPLOY_SCRIPT_CMD="/system script add name=\"LE Cert Deploy - $_cdomain\" owner=admin policy=ftp,read,write,password,sensitive
ssh "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST" "/system script add name=\"LE Cert Deploy - $_cdomain\" owner=admin policy=\ source=\"## generated by routeros deploy script in acme.sh
ftp,read,write,password,sensitive source=\"## generated by routeros deploy script in acme.sh \\r\ \n/certificate remove [ find name=$_cdomain.cer_0 ]
\n/certificate remove [ find name=$_cdomain.cer_0 ]\\r\ \n/certificate remove [ find name=$_cdomain.cer_1 ]
\n/certificate remove [ find name=$_cdomain.cer_1 ]\\r\ \ndelay 1
\ndelay 1\\r\ \n/certificate import file-name=$_cdomain.cer passphrase=\\\"\\\"
\n/certificate import file-name=$_cdomain.cer passphrase=\\\"\\\"\\r\ \n/certificate import file-name=$_cdomain.key passphrase=\\\"\\\"
\n/certificate import file-name=$_cdomain.key passphrase=\\\"\\\"\\r\ \ndelay 1
\ndelay 1\\r\ \n/file remove $_cdomain.cer
\n/file remove $_cdomain.cer\\r\ \n/file remove $_cdomain.key
\n/file remove $_cdomain.key\\r\ \ndelay 2
\ndelay 2\\r\ \n/ip service set www-ssl certificate=$_cdomain.cer_0
\n/ip service set www-ssl certificate=$_cdomain.cer_0\\r\ \n$ROUTER_OS_ADDITIONAL_SERVICES
\n$ROUTER_OS_ADDITIONAL_SERVICES\\r\
\n\" \n\"
" "
# shellcheck disable=SC2029
ssh "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST" "$DEPLOY_SCRIPT_CMD"
# shellcheck disable=SC2029 # shellcheck disable=SC2029
ssh "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST" "/system script run \"LE Cert Deploy - $_cdomain\"" ssh "$ROUTER_OS_USERNAME@$ROUTER_OS_HOST" "/system script run \"LE Cert Deploy - $_cdomain\""
# shellcheck disable=SC2029 # shellcheck disable=SC2029