backup: Use 'type' instead of 'which' to prevent unnecessary dependency
This fixes using minimal-template based VMs to store/retrieve backup.
This commit is contained in:
parent
c99dca37ce
commit
5157d9822e
@ -9,7 +9,7 @@ if [ -d "$args" ] ; then
|
||||
else
|
||||
echo "Checking if arguments is matching a command"
|
||||
COMMAND=`echo $args | cut -d ' ' -f 1`
|
||||
if which "$COMMAND"; then
|
||||
if type "$COMMAND"; then
|
||||
echo "Redirecting STDIN to $args"
|
||||
# Parsing args to handle quotes correctly
|
||||
# Dangerous method if args are uncontrolled
|
||||
|
@ -11,7 +11,7 @@ if [ -f "$args" ] ; then
|
||||
else
|
||||
echo "Checking if arguments is matching a command" >&2
|
||||
COMMAND=`echo $args | cut -d ' ' -f 1`
|
||||
if which "$COMMAND" >/dev/null; then
|
||||
if type "$COMMAND" >/dev/null; then
|
||||
tmpdir=`mktemp -d`
|
||||
mkfifo $tmpdir/backup-data
|
||||
echo "Redirecting $args to STDOUT" >&2
|
||||
|
Loading…
Reference in New Issue
Block a user