Merge pull request #86 from asteven/global-explorer-fixup

ignore errors in global explorers
This commit is contained in:
Nico Schottelius 2012-08-03 01:54:13 -07:00
commit 2be4b36da0
8 changed files with 18 additions and 8 deletions

View file

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# #
# 2010-2011 Nico Schottelius (nico-cdist at schottelius.org) # 2010-2011 Nico Schottelius (nico-cdist at schottelius.org)
# 2012 Steven Armstrong (steven-cdist at armstrong.cc)
# #
# This file is part of cdist. # This file is part of cdist.
# #
@ -19,4 +20,6 @@
# #
# #
hostname if command -v hostname; then
hostname
fi

View file

@ -24,11 +24,16 @@
# #
# Use ip, if available # 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' ip -o link show | sed -n 's/^[0-9]\+: \(.\+\): <.*/\1/p'
exit 0 exit 0
fi fi
if ! command -v ifconfig; then
# no ifconfig, nothing we could do
exit 0
fi
uname_s="$(uname -s)" uname_s="$(uname -s)"
REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p' REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'

View file

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_CODENAME") (. /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 if [ -x "$lsb_release" ]; then
$lsb_release --short --codename $lsb_release --short --codename
fi fi

View file

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_DESCRIPTION") (. /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 if [ -x "$lsb_release" ]; then
$lsb_release --short --description $lsb_release --short --description
fi fi

View file

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_ID") (. /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 if [ -x "$lsb_release" ]; then
$lsb_release --short --id $lsb_release --short --id
fi fi

View file

@ -25,7 +25,7 @@ case "$($__explorer/os)" in
(. /etc/openwrt_release && echo "$DISTRIB_RELEASE") (. /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 if [ -x "$lsb_release" ]; then
$lsb_release --short --release $lsb_release --short --release
fi fi

View file

@ -22,4 +22,6 @@
# #
# #
uname -m if command -v uname; then
uname -m
fi

View file

@ -20,7 +20,7 @@
# #
set +e set +e
executable=$(which runlevel 2>/dev/null) executable=$(command -v runlevel)
if [ -x "$executable" ]; then if [ -x "$executable" ]; then
"$executable" | awk '{ print $2 }' "$executable" | awk '{ print $2 }'
fi fi