Merge pull request #86 from asteven/global-explorer-fixup
ignore errors in global explorers
This commit is contained in:
commit
2be4b36da0
8 changed files with 18 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
|
||||
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
|
||||
#
|
||||
# This file is part of cdist.
|
||||
#
|
||||
|
@ -19,4 +20,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
if command -v hostname; then
|
||||
hostname
|
||||
fi
|
||||
|
|
|
@ -24,11 +24,16 @@
|
|||
#
|
||||
|
||||
# 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 ! command -v ifconfig; then
|
||||
# no ifconfig, nothing we could do
|
||||
exit 0
|
||||
fi
|
||||
|
||||
uname_s="$(uname -s)"
|
||||
REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'
|
||||
|
||||
|
|
|
@ -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,4 +22,6 @@
|
|||
#
|
||||
#
|
||||
|
||||
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