confz

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

commit 2c51e9851df2799e2e048ebb9b25907e112b8950
parent 175d74b342dffae4d1dd04099e7c5051058cfcac
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Thu, 19 Jun 2014 19:55:17 +0200

use newer arg checks, relax opts
Diffstat:
Mzsh-functions/confz_fs_init | 3+--
Mzsh-functions/confz_vserver_init | 18++----------------
2 files changed, 3 insertions(+), 18 deletions(-)

diff --git a/zsh-functions/confz_fs_init b/zsh-functions/confz_fs_init @@ -122,9 +122,8 @@ confz_mounted_check() { # create LVM2 logical volume, and make sure it's in fstab and mounted confz_mounted_volume_check() { - checkvars lv_name opts label + checkvars lv_name label defvar filesystem xfs - defvar opts noatime defvar label $vars[lv_name] require logical_volume %device :vg_name :size :lv_name diff --git a/zsh-functions/confz_vserver_init b/zsh-functions/confz_vserver_init @@ -7,11 +7,7 @@ # deploy filesystem image from directory, rsync or tarball confz_deployed_system_check() { - [[ -n ${vars[path]} ]] || \ - die "$0: no 'path' was passed" - - [[ -n ${vars[source]} ]] || \ - die "$0: no 'source' was passed" + checkvars path source if [[ ${vars[source]} == */ ]]; then do_command=( rsync -aAH ${vars[source]} ${vars[path]}/ ) @@ -26,17 +22,7 @@ confz_deployed_system_check() { # configure and deploy vserver confz_vserver_check() { - [[ -n ${vars[name]} ]] || \ - die "$0: no 'name' was passed" - - [[ -n ${vars[size]} ]] || \ - die "$0: no 'size' was passed" - - [[ -n ${vars[context_id]} ]] || \ - die "$0: no 'context_id' was passed" - - [[ -n ${vars[source]} ]] || \ - die "$0: no 'source' was passed" + checkvars name size context_id source setvar etcdir /etc/vservers/${vars[name]} setvar vdir /vservers/${vars[name]}