Use hash instead of which in expand-root

Also remove the variable since we established that it is already in the
$PATH

Signed-off-by: Andrew Garrett <andrew.garrett@getbraintree.com>
This commit is contained in:
Jesse Szwedko 2016-01-12 18:33:22 +00:00 committed by Jonh
parent 78b796be5b
commit 4429c226a8

View file

@ -13,14 +13,14 @@
prog=$(basename $0) prog=$(basename $0)
logger="logger -t $prog" logger="logger -t $prog"
growpart=$(which growpart) || { hash growpart 2> /dev/null || {
$logger "growpart was not found on PATH. Unable to expand size." $logger "growpart was not found on PATH. Unable to expand size."
exit 1 exit 1
} }
root_index="0" root_index="0"
$growpart /dev/xvda $root_index || { growpart /dev/xvda $root_index || {
$logger "growpart failed. Unable to expand size." $logger "growpart failed. Unable to expand size."
exit 1 exit 1
} }