Files
gvm/scripts/alias-delete
T
Ali Abbas c1ec392bdd - Double quoting to avoid globbing
- Remove unecessary $(cat)
- switch * to ./* to avoid entries with dashes to be treated as options
- replace $* with "$@"
- repeating change path serial calls - unecessary if change path is called one (get script)
2014-04-12 15:56:54 +02:00

19 lines
449 B
Bash
Executable File

#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions"
[[ $1 != "" ]] ||
display_fatal "Please specifiy the name"
[[ -f $GVM_ROOT/environments/$1 ]] ||
display_fatal "Alias doesn't exist!"
$GREP_PATH "gvm_alias_name" "$GVM_ROOT/environments/$1" > /dev/null ||
display_fatal "$1 is not an alias!"
rm -rf "$GVM_ROOT/environments/$1" ||
display_fatal "Could not delete alias"
rm -rf "$GVM_ROOT/gos/$1" ||
display_fatal "Could not delete alias"