mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-11-10 00:11:45 +00:00
Move call to remote system into separate function
This commit is contained in:
parent
3d9608faa0
commit
04771e5a4a
@ -31,6 +31,7 @@ ssh_deploy() {
|
|||||||
_ccert="$3"
|
_ccert="$3"
|
||||||
_cca="$4"
|
_cca="$4"
|
||||||
_cfullchain="$5"
|
_cfullchain="$5"
|
||||||
|
_err_code=0
|
||||||
_cmdstr=""
|
_cmdstr=""
|
||||||
_homedir='~'
|
_homedir='~'
|
||||||
_backupprefix="$_homedir/.acme_ssh_deploy/$_cdomain-backup"
|
_backupprefix="$_homedir/.acme_ssh_deploy/$_cdomain-backup"
|
||||||
@ -190,16 +191,25 @@ then rm -rf \"\$fn\"; echo \"Backup \$fn deleted as older than 180 days\"; fi; d
|
|||||||
_info "Backup directories erased after 180 days."
|
_info "Backup directories erased after 180 days."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_secure_debug "Remote commands to execute: " "$_cmdstr"
|
if ! _ssh_remote_cmd "$_cmdstr"; then
|
||||||
_info "Submitting sequence of commands to remote server by ssh"
|
return $_err_code
|
||||||
# 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 "'$_cmdstr'"
|
|
||||||
_ret="$?"
|
|
||||||
|
|
||||||
if [ "$_ret" != "0" ]; then
|
|
||||||
_err "Error code $_ret returned from $Le_Deploy_ssh_cmd"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return $_ret
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
#cmd
|
||||||
|
_ssh_remote_cmd() {
|
||||||
|
_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'"
|
||||||
|
_err_code="$?"
|
||||||
|
|
||||||
|
if [ "$_err_code" != "0" ]; then
|
||||||
|
_err "Error code $_err_code returned from $Le_Deploy_ssh_cmd"
|
||||||
|
fi
|
||||||
|
|
||||||
|
return $_err_code
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user