confz

git mirror of https://ccx.te2000.cz/bzr/confz
git clone https://ccx.te2000.cz/git/confz
Log | Files | Refs

commit 954641ebe954ff700ddc0e3fa76134d704d2b7b2
parent 3d18eeff99aad7822a1137e990e20e2a2f6e0dfb
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Wed, 21 Dec 2016 21:14:05 +0100

allow deploying via sftp and tmpdir
Diffstat:
Mzsh-functions/confz_vserver_init | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/zsh-functions/confz_vserver_init b/zsh-functions/confz_vserver_init @@ -16,6 +16,8 @@ confz_deployed_system_check() { } confz_deployed_system_do() { + local result + result=0 case ${vars[source]} in (*/) rsync -aAH ${vars[source]} ${vars[path]}/ || return $?;; @@ -31,9 +33,16 @@ confz_deployed_system_do() { (scp:*) scp -q ${vars[source]#scp:} /dev/stdout | tar -xpC ${vars[path]} return $[ $pipestatus[1] | $pipestatus[2] ];; + (sftp:*) + mkdir -p /root/.tmp || return $? + (cd /root/.tmp && sftp ${vars[source]#sftp:}) || return $? + tar -xpC ${vars[path]} -f /root/.tmp/${vars[source]:t} + return $? + rm -f /root/.tmp/${vars[source]:t} (*) tar -xpC ${vars[path]} -f ${vars[source]} || return $?;; esac + return $result } # create required directories