Skip to content

Commit

Permalink
use command -v instead of type to check for shell functions
Browse files Browse the repository at this point in the history
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
  • Loading branch information
evgeni committed Dec 18, 2015
1 parent 8bf173e commit 22eb22e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion debian/bareos-director.bareos-dir.init.in
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/bareos-filedaemon.bareos-fd.init.in
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/bareos-storage.bareos-sd.init.in
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/bareos-config-lib.sh.in
Expand Up @@ -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 $?
}

Expand Down

0 comments on commit 22eb22e

Please sign in to comment.