format-disk.sh: fix conditions, arguments passed to nix
This commit is contained in:
parent
21c6541f01
commit
185e249f7c
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
useConfig=false config="" ceph=true luks=true zfs=true
|
||||
useConfig=false config='""' ceph=true luks=true zfs=true
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null || exit 1
|
||||
|
||||
|
@ -29,6 +29,7 @@ while [[ $# -gt 0 ]]; do
|
|||
;;
|
||||
"--disk")
|
||||
disk=$2
|
||||
shift
|
||||
;;
|
||||
"--no-ceph") ceph=false;;
|
||||
"--no-luks") luks=false;;
|
||||
|
@ -41,7 +42,8 @@ while [[ $# -gt 0 ]]; do
|
|||
shift
|
||||
done
|
||||
|
||||
if [[ -z ${name:-} || (-n ${config:-} && -n ${disk:-}) ]]; then
|
||||
if [[ -z ${name:-} && (-n ${config:-} || -n ${disk:-}) ]]; then
|
||||
echo $name $config $disk
|
||||
# echo "--name and either config or disk must be supplied!"
|
||||
echo "--name and disk must be supplied!"
|
||||
exit 1
|
||||
|
|
Loading…
Reference in New Issue