From 2856684e51a30ec78fe245bc3786b1a783c39541 Mon Sep 17 00:00:00 2001
From: Steven Armstrong <steven@icarus.ethz.ch>
Date: Fri, 22 Jun 2012 09:30:47 +0200
Subject: [PATCH] ignore errors in global explorers

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
---
 conf/explorer/hostname   | 5 ++++-
 conf/explorer/interfaces | 5 +++++
 conf/explorer/machine    | 4 +++-
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/conf/explorer/hostname b/conf/explorer/hostname
index a3ae4e15..429a5077 100755
--- a/conf/explorer/hostname
+++ b/conf/explorer/hostname
@@ -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 @@
 #
 #
 
-hostname
+if which hostname >/dev/null 2>&1; then
+   hostname
+fi
diff --git a/conf/explorer/interfaces b/conf/explorer/interfaces
index 76ff32bb..5333b408 100755
--- a/conf/explorer/interfaces
+++ b/conf/explorer/interfaces
@@ -29,6 +29,11 @@ if which ip >/dev/null 2>&1; then
     exit 0
 fi
 
+if ! which ifconfig >/dev/null 2>&1; then
+   # no ifconfig, nothing we could do
+   exit 0
+fi
+
 uname_s="$(uname -s)"
 REGEXP='s/^(.*)(:[[:space:]]*flags=|Link encap).*/\1/p'
 
diff --git a/conf/explorer/machine b/conf/explorer/machine
index 25fc76a9..d295c8e0 100755
--- a/conf/explorer/machine
+++ b/conf/explorer/machine
@@ -22,4 +22,6 @@
 #
 #
 
-uname -m
+if which uname >/dev/null 2>&1; then
+   uname -m
+fi