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
6420d123
Commit
6420d123
authored
Feb 22, 2020
by
dkerr64
Browse files
Move call to remote system into separate function
parent
3d9608fa
Changes
1
Show whitespace changes
Inline
Side-by-side
deploy/ssh.sh
View file @
6420d123
...
...
@@ -31,6 +31,7 @@ ssh_deploy() {
_ccert
=
"
$3
"
_cca
=
"
$4
"
_cfullchain
=
"
$5
"
_err_code
=
0
_cmdstr
=
""
_homedir
=
'~'
_backupprefix
=
"
$_homedir
/.acme_ssh_deploy/
$_cdomain
-backup"
...
...
@@ -190,16 +191,26 @@ then rm -rf \"\$fn\"; echo \"Backup \$fn deleted as older than 180 days\"; fi; d
_info
"Backup directories erased after 180 days."
fi
_secure_debug
"Remote commands to execute: "
"
$_cmdstr
"
_info
"Submitting sequence of commands to remote server by ssh"
if
!
_ssh_remote_cmd
"
$_cmdstr
"
;
then
return
$_err_code
fi
return
0
}
#cmd
_ssh_remote_cmd
()
{
_cmd
=
"
$1
"
_secure_debug
"Remote commands to execute:
$_cmd
"
_info
"Submitting sequence of commands to remote server by
$Le_Deploy_ssh_cmd
"
# quotations in bash cmd below intended. Squash travis spellcheck error
# shellcheck disable=SC2029
$Le_Deploy_ssh_cmd
"
$Le_Deploy_ssh_user
@
$Le_Deploy_ssh_server
"
sh
-c
"'
$_cmd
str
'"
_
ret
=
"
$?
"
$Le_Deploy_ssh_cmd
"
$Le_Deploy_ssh_user
@
$Le_Deploy_ssh_server
"
sh
-c
"'
$_cmd
'"
_
err_code
=
"
$?
"
if
[
"
$_
ret
"
!=
"0"
]
;
then
_err
"Error code
$_
ret
returned from
$Le_Deploy_ssh_cmd
"
if
[
"
$_
err_code
"
!=
"0"
]
;
then
_err
"Error code
$_
err_code
returned from
$Le_Deploy_ssh_cmd
"
fi
return
$_
ret
return
$_
err_code
}
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