forked from ungleich-public/cdist
/which/command -v/
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
2856684e51
commit
d13a201cd0
8 changed files with 9 additions and 9 deletions
|
@ -20,6 +20,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
if which hostname >/dev/null 2>&1; then
|
||||
if command -v hostname; then
|
||||
hostname
|
||||
fi
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,6 +22,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
if which uname >/dev/null 2>&1; then
|
||||
if command -v uname; then
|
||||
uname -m
|
||||
fi
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue