aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/zpool-create.sh
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-01-20 14:10:30 -0800
committerBrian Behlendorf <[email protected]>2009-01-20 14:10:30 -0800
commitdb210bf236c14b2b013c1fe115a5c357b1b1743b (patch)
treef40a786c5d4c348098fbd9db345a65a6a686d648 /scripts/zpool-create.sh
parent5bf49743a6e0f1c79606da6af3ed00bc7629b8f3 (diff)
Add destroy functionality to zpool create, needed for generic use by zpios.sh
Diffstat (limited to 'scripts/zpool-create.sh')
-rwxr-xr-xscripts/zpool-create.sh17
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"