Browse Source

Travis errors

David Kerr 8 years ago
parent
commit
62e7d904b4
1 changed files with 11 additions and 10 deletions
  1. 11 10
      deploy/sshdeploy.sh

+ 11 - 10
deploy/sshdeploy.sh

@@ -22,8 +22,6 @@
 # export ACME_DEPLOY_SSH_REMOTE_CMD="/etc/init.d/stunnel.sh restart"
 # export ACME_DEPLOY_SSH_REMOTE_CMD="/etc/init.d/stunnel.sh restart"
 # export ACME_DEPLOY_SSH_SERVICE_START=""
 # export ACME_DEPLOY_SSH_SERVICE_START=""
 
 
-. "$DOMAIN_CONF"
-
 ########  Public functions #####################
 ########  Public functions #####################
 
 
 #domain keyfile certfile cafile fullchain
 #domain keyfile certfile cafile fullchain
@@ -34,9 +32,12 @@ sshdeploy_deploy() {
   _cca="$4"
   _cca="$4"
   _cfullchain="$5"
   _cfullchain="$5"
   _cmdstr=""
   _cmdstr=""
-  _homedir="~/.acme_ssh_deploy"
+  _homedir='~'
+  _homedir="$_homedir/.acme_ssh_deploy"
   _backupdir="$_homedir/certs-backup-$(date +%Y%m%d%H%M%S)"
   _backupdir="$_homedir/certs-backup-$(date +%Y%m%d%H%M%S)"
 
 
+  . "$DOMAIN_CONF"
+  
   _debug _cdomain "$_cdomain"
   _debug _cdomain "$_cdomain"
   _debug _ckey "$_ckey"
   _debug _ckey "$_ckey"
   _debug _ccert "$_ccert"
   _debug _ccert "$_ccert"
@@ -61,7 +62,7 @@ sshdeploy_deploy() {
   elif [ -z "$Le_Deploy_ssh_url" ]; then
   elif [ -z "$Le_Deploy_ssh_url" ]; then
     Le_Deploy_ssh_url="$_cdomain"
     Le_Deploy_ssh_url="$_cdomain"
   fi
   fi
-  
+
   _info "Deploy certificates to remote server $Le_Deploy_ssh_user@$Le_Deploy_ssh_url"
   _info "Deploy certificates to remote server $Le_Deploy_ssh_user@$Le_Deploy_ssh_url"
 
 
   # SERVICE_STOP is optional.
   # SERVICE_STOP is optional.
@@ -146,9 +147,9 @@ sshdeploy_deploy() {
     _savedomainconf Le_Deploy_ssh_remote_cmd "$Le_Deploy_ssh_remote_cmd"
     _savedomainconf Le_Deploy_ssh_remote_cmd "$Le_Deploy_ssh_remote_cmd"
   fi
   fi
   if [ -n "$Le_Deploy_ssh_remote_cmd" ]; then
   if [ -n "$Le_Deploy_ssh_remote_cmd" ]; then
-     if [ -n "$Le_Deploy_ssh_service_stop" ]; then
-       _cmdstr="$_cmdstr sleep 2 ;"
-     fi
+    if [ -n "$Le_Deploy_ssh_service_stop" ]; then
+      _cmdstr="$_cmdstr sleep 2 ;"
+    fi
     _cmdstr="$_cmdstr $Le_Deploy_ssh_remote_cmd ;"
     _cmdstr="$_cmdstr $Le_Deploy_ssh_remote_cmd ;"
     _info "Will execute remote command $Le_Deploy_ssh_remote_cmd"
     _info "Will execute remote command $Le_Deploy_ssh_remote_cmd"
   fi
   fi
@@ -162,9 +163,9 @@ sshdeploy_deploy() {
     _savedomainconf Le_Deploy_ssh_service_start "$Le_Deploy_ssh_service_start"
     _savedomainconf Le_Deploy_ssh_service_start "$Le_Deploy_ssh_service_start"
   fi
   fi
   if [ -n "$Le_Deploy_ssh_service_start" ]; then
   if [ -n "$Le_Deploy_ssh_service_start" ]; then
-     if [ -n "$Le_Deploy_ssh_service_stop" ] || [ -n "$Le_Deploy_ssh_remote_cmd" ] ; then
-       _cmdstr="$_cmdstr sleep 2 ;"
-     fi
+    if [ -n "$Le_Deploy_ssh_service_stop" ] || [ -n "$Le_Deploy_ssh_remote_cmd" ] ; then
+      _cmdstr="$_cmdstr sleep 2 ;"
+    fi
     _cmdstr="$_cmdstr $Le_Deploy_ssh_service_start ;"
     _cmdstr="$_cmdstr $Le_Deploy_ssh_service_start ;"
     _info "Will start remote service with command $Le_Deploy_ssh_remote_cmd"
     _info "Will start remote service with command $Le_Deploy_ssh_remote_cmd"
   fi
   fi