From b6deb83bb5734e64842b2ac8655c89931ca2ec34 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 20 Jul 2017 08:17:26 +0200 Subject: Added nFast scripts. --- tools/nfast-partition-del | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 tools/nfast-partition-del (limited to 'tools/nfast-partition-del') diff --git a/tools/nfast-partition-del b/tools/nfast-partition-del new file mode 100755 index 0000000..9fddba3 --- /dev/null +++ b/tools/nfast-partition-del @@ -0,0 +1,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 [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 -- cgit