summaryrefslogtreecommitdiffstats
path: root/tools/nfast-partition-del
blob: 9fddba3e1bdb75029d8f0bcdd49eef7b7e20e83e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh

verbose=

# read the options
TEMP=`getopt -o v --long help -n 'nfast-partition-del' -- "$@"`
eval set -- "$TEMP"

# extract options and their arguments into variables.
while true ; do
    case "$1" in
        --help)
            echo "Usage: nfast-partition-del <name> [OPTIONS]"
            echo
            echo "Options:"
            echo " -v                   Run in verbose mode."
            echo " --help               Show help message."
            exit 0
            ;;
        -v)
            verbose=1
            shift
            ;;
        --)
            shift
            break
            ;;
        *)
            echo "Error: invalid option $1" >&2
            echo "Run nfast-partition-del --help for help." >&2
            exit 1
            ;;
    esac
done

partition=$1

if [[ "$verbose" != "" ]]
then
    echo "partition name: $partition"
fi

if [[ "$partition" == "" ]]
then
    echo "Error: missing partition name" >&2
    echo "Run nfast-partition-del --help for help." >&2
    exit 1
fi

echo -e "yes\n" | /opt/nfast/bin/ppmk --delete $partition