=== modified file 'zsh-functions/confz_vserver_init' --- zsh-functions/confz_vserver_init 2017-01-11 16:08:51 +0000 +++ zsh-functions/confz_vserver_init 2016-12-21 20:59:21 +0000 @@ -10,19 +10,9 @@ # deploy filesystem image from directory, rsync or tarball confz_deployed_system_check() { checkvars path source - local existing_entries - fail_reason="${vars[path]}/.confz_deployed missing" - if [[ -e ${vars[path]}/.confz_deployed ]]; then - return 0 - else - existing_entries=( ${vars[path]}/*(DN) ) - if (($#existing_entries)); then - die "Found $#existing_entries in ${vars[path]} but no .confz_deployed" - else - return 1 - fi - fi + fail_reason="${vars[path]}/bin missing" + [[ -e ${vars[path]}/bin ]] } confz_deployed_system_do() { @@ -33,16 +23,16 @@ rsync -aAH ${vars[source]} ${vars[path]}/ || return $?;; (scp:*.(tbz|tbz2|bz2)) scp -q ${vars[source]#scp:} /dev/stdout | bzip2 -d | tar -xpC ${vars[path]} - result=$[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; + return $[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; (scp:*.(tgz|gz)) scp -q ${vars[source]#scp:} /dev/stdout | gzip -d | tar -xpC ${vars[path]} - result=$[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; + return $[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; (scp:*.xz) scp -q ${vars[source]#scp:} /dev/stdout | xz -d | tar -xpC ${vars[path]} - result=$[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; + return $[ $pipestatus[1] | $pipestatus[2] | $pipestatus[3] ];; (scp:*) scp -q ${vars[source]#scp:} /dev/stdout | tar -xpC ${vars[path]} - result=$[ $pipestatus[1] | $pipestatus[2] ];; + return $[ $pipestatus[1] | $pipestatus[2] ];; (sftp:*) mkdir -p /root/.tmp || return $? (cd /root/.tmp && sftp ${vars[source]#sftp:}) || return $? @@ -52,10 +42,7 @@ (*) tar -xpC ${vars[path]} -f ${vars[source]} || return $?;; esac - if (($result)); then - return $result - fi - printf '%s\n' ${vars[source]} >${vars[path]}/.confz_deployed + return $result } # create required directories