diff options
author | Brian Behlendorf <[email protected]> | 2009-01-20 14:10:30 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-01-20 14:10:30 -0800 |
commit | db210bf236c14b2b013c1fe115a5c357b1b1743b (patch) | |
tree | f40a786c5d4c348098fbd9db345a65a6a686d648 /scripts/zpool-create.sh | |
parent | 5bf49743a6e0f1c79606da6af3ed00bc7629b8f3 (diff) |
Add destroy functionality to zpool create, needed for generic use by zpios.sh
Diffstat (limited to 'scripts/zpool-create.sh')
-rwxr-xr-x | scripts/zpool-create.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/zpool-create.sh b/scripts/zpool-create.sh index 4b8e3a8bf..e613e671c 100755 --- a/scripts/zpool-create.sh +++ b/scripts/zpool-create.sh @@ -14,8 +14,9 @@ DESCRIPTION: OPTIONS: -h Show this message -v Verbose - -c Zpool configuration - -p Zpool name + -c Configuration for zpool + -p Name for zpool + -d Destroy zpool (default create) EOF } @@ -39,8 +40,9 @@ check_config() { ZPOOL_CONFIG=zpool_config.cfg ZPOOL_NAME=tank +ZPOOL_DESTROY= -while getopts 'hvc:p:' OPTION; do +while getopts 'hvc:p:d' OPTION; do case $OPTION in h) usage @@ -55,6 +57,9 @@ while getopts 'hvc:p:' OPTION; do p) ZPOOL_NAME=${OPTARG} ;; + d) + ZPOOL_DESTROY=1 + ;; ?) usage exit @@ -69,6 +74,12 @@ fi check_config || die "${ERROR}" . ${ZPOOL_CONFIG} +if [ ${ZPOOL_DESTROY} ]; then + zpool_destroy +else + zpool_create +fi + if [ ${VERBOSE} ]; then echo echo "zpool list" |