root/src/usr/local/sbin/cleargpt.sh @ 6c3d8b45
1 | 31e66b41 | Renato Botelho | #!/bin/sh
|
---|---|---|---|
2 | DISK=$1 |
||
3 | if [ "$DISK" = "" ]; then |
||
4 | echo "You must specify the disk that should be formatted/cleared." |
||
5 | exit 1
|
||
6 | fi
|
||
7 | for PART in `/sbin/gpart show $DISK | grep -v '=>' | awk '{ print $3 }'`; do |
||
8 | if [ "$PART" != "" ]; then |
||
9 | /sbin/gpart delete -i $PART $DISK >/dev/null |
||
10 | fi
|
||
11 | done
|
||
12 | /sbin/gpart destroy $DISK >/dev/null |
||
13 | exit 0
|