From d13a201cd092b5eb078988d53224a8ec52d4152b Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 25 Jun 2012 20:19:10 +0200 Subject: [PATCH] /which/command -v/ Signed-off-by: Steven Armstrong --- conf/explorer/hostname | 2 +- conf/explorer/interfaces | 4 ++-- conf/explorer/lsb_codename | 2 +- conf/explorer/lsb_description | 2 +- conf/explorer/lsb_id | 2 +- conf/explorer/lsb_release | 2 +- conf/explorer/machine | 2 +- conf/explorer/runlevel | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/explorer/hostname b/conf/explorer/hostname index 429a5077..2ae23759 100755 --- a/conf/explorer/hostname +++ b/conf/explorer/hostname @@ -20,6 +20,6 @@ # # -if which hostname >/dev/null 2>&1; then +if command -v hostname; then hostname fi diff --git a/conf/explorer/interfaces b/conf/explorer/interfaces index 5333b408..6804f2db 100755 --- a/conf/explorer/interfaces +++ b/conf/explorer/interfaces @@ -24,12 +24,12 @@ # # Use ip, if available -if which ip >/dev/null 2>&1; then +if command -v ip; then ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p' exit 0 fi -if ! which ifconfig >/dev/null 2>&1; then +if ! command -v ifconfig; then # no ifconfig, nothing we could do exit 0 fi diff --git a/conf/explorer/lsb_codename b/conf/explorer/lsb_codename index 22b6d51e..eebd3e0f 100755 --- a/conf/explorer/lsb_codename +++ b/conf/explorer/lsb_codename @@ -25,7 +25,7 @@ case "$($__explorer/os)" in (. /etc/openwrt_release && echo "$DISTRIB_CODENAME") ;; *) - lsb_release=$(which lsb_release 2>/dev/null) + lsb_release=$(command -v lsb_release) if [ -x "$lsb_release" ]; then $lsb_release --short --codename fi diff --git a/conf/explorer/lsb_description b/conf/explorer/lsb_description index 48aff30d..23f45421 100755 --- a/conf/explorer/lsb_description +++ b/conf/explorer/lsb_description @@ -25,7 +25,7 @@ case "$($__explorer/os)" in (. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION") ;; *) - lsb_release=$(which lsb_release 2>/dev/null) + lsb_release=$(command -v lsb_release) if [ -x "$lsb_release" ]; then $lsb_release --short --description fi diff --git a/conf/explorer/lsb_id b/conf/explorer/lsb_id index 0dd0f9f4..9754eb63 100755 --- a/conf/explorer/lsb_id +++ b/conf/explorer/lsb_id @@ -25,7 +25,7 @@ case "$($__explorer/os)" in (. /etc/openwrt_release && echo "$DISTRIB_ID") ;; *) - lsb_release=$(which lsb_release 2>/dev/null) + lsb_release=$(command -v lsb_release) if [ -x "$lsb_release" ]; then $lsb_release --short --id fi diff --git a/conf/explorer/lsb_release b/conf/explorer/lsb_release index 8266171a..35b5547c 100755 --- a/conf/explorer/lsb_release +++ b/conf/explorer/lsb_release @@ -25,7 +25,7 @@ case "$($__explorer/os)" in (. /etc/openwrt_release && echo "$DISTRIB_RELEASE") ;; *) - lsb_release=$(which lsb_release 2>/dev/null) + lsb_release=$(command -v lsb_release) if [ -x "$lsb_release" ]; then $lsb_release --short --release fi diff --git a/conf/explorer/machine b/conf/explorer/machine index d295c8e0..bb6e0beb 100755 --- a/conf/explorer/machine +++ b/conf/explorer/machine @@ -22,6 +22,6 @@ # # -if which uname >/dev/null 2>&1; then +if command -v uname; then uname -m fi diff --git a/conf/explorer/runlevel b/conf/explorer/runlevel index 7cdd81ef..02d3a245 100755 --- a/conf/explorer/runlevel +++ b/conf/explorer/runlevel @@ -20,7 +20,7 @@ # set +e -executable=$(which runlevel 2>/dev/null) +executable=$(command -v runlevel) if [ -x "$executable" ]; then "$executable" | awk '{ print $2 }' fi