From 22eb22e4efdf402c4d39637b9e2c0e74d601cea1 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 18 Dec 2015 08:28:09 +0100 Subject: [PATCH] use command -v instead of type to check for shell functions command -v is optional in IEEE Std 1003.1, 2004 Edition [1] and required in IEEE Std 1003.1, 2013 Edition [2] [1] http://pubs.opengroup.org/onlinepubs/009695399/utilities/command.html [2] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html --- debian/bareos-director.bareos-dir.init.in | 2 +- debian/bareos-filedaemon.bareos-fd.init.in | 2 +- debian/bareos-storage.bareos-sd.init.in | 2 +- scripts/bareos-config-lib.sh.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/bareos-director.bareos-dir.init.in b/debian/bareos-director.bareos-dir.init.in index 996626f7a6c..aaed75bf48f 100755 --- a/debian/bareos-director.bareos-dir.init.in +++ b/debian/bareos-director.bareos-dir.init.in @@ -45,7 +45,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin . /lib/lsb/init-functions # workaround, if status_of_proc is not defined (Ubuntu 8.04) -if ! type status_of_proc >/dev/null; then +if ! command -v status_of_proc >/dev/null; then status_of_proc () { local pidfile daemon name status OPTIND diff --git a/debian/bareos-filedaemon.bareos-fd.init.in b/debian/bareos-filedaemon.bareos-fd.init.in index 1fbf582886d..2d97b4cf52b 100755 --- a/debian/bareos-filedaemon.bareos-fd.init.in +++ b/debian/bareos-filedaemon.bareos-fd.init.in @@ -46,7 +46,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin . /lib/lsb/init-functions # workaround, if status_of_proc is not defined (Ubuntu 8.04) -if ! type status_of_proc >/dev/null; then +if ! command -v status_of_proc >/dev/null; then status_of_proc () { local pidfile daemon name status OPTIND diff --git a/debian/bareos-storage.bareos-sd.init.in b/debian/bareos-storage.bareos-sd.init.in index bc5108bd855..e2564ed6742 100755 --- a/debian/bareos-storage.bareos-sd.init.in +++ b/debian/bareos-storage.bareos-sd.init.in @@ -43,7 +43,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin . /lib/lsb/init-functions # workaround, if status_of_proc is not defined (Ubuntu 8.04) -if ! type status_of_proc >/dev/null; then +if ! command -v status_of_proc >/dev/null; then status_of_proc () { local pidfile daemon name status OPTIND diff --git a/scripts/bareos-config-lib.sh.in b/scripts/bareos-config-lib.sh.in index 3ed51c07e34..084cbbe0d99 100644 --- a/scripts/bareos-config-lib.sh.in +++ b/scripts/bareos-config-lib.sh.in @@ -37,7 +37,7 @@ os_type=`uname -s` is_function() { func=${1-} - test "$func" && type "$func" > /dev/null 2>&1 + test "$func" && command -v "$func" > /dev/null 2>&1 return $? }