summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-05-17 15:33:00 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-05-17 15:39:44 +0200
commitb8053ff61cb34cd2e962a66f49750e66d53d0ab5 (patch)
treee50429ca24d6effaec293a874984de3fd06a821c
parent27436f8b8a84fa70bba3a7b7d286fd3eba37fbfe (diff)
downloadtools-b8053ff61cb34cd2e962a66f49750e66d53d0ab5.tar.gz
tools-b8053ff61cb34cd2e962a66f49750e66d53d0ab5.tar.bz2
tools-b8053ff61cb34cd2e962a66f49750e66d53d0ab5.zip
bin/hostinfo: ignore HOSTINFO_PATH if its empty
If the environment variable HOSTINFO_PATH is an empty string it is now handled as if the variable is unset. With this you can overwrite a global value in the shell simply with the following command: HOSTINFO_PATH="" hostinfo ...
-rwxr-xr-xbin/hostinfo2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/hostinfo b/bin/hostinfo
index 43fd5b4..88fe388 100755
--- a/bin/hostinfo
+++ b/bin/hostinfo
@@ -89,7 +89,7 @@ def print_help(self_name):
def main():
self_name = sys.argv.pop(0)
basepath = '/usr/local/share/hostinfo'
- if 'HOSTINFO_PATH' in os.environ:
+ if 'HOSTINFO_PATH' in os.environ and os.environ['HOSTINFO_PATH'] != '':
basepath = os.environ['HOSTINFO_PATH']
file = oneline = keys = verbose = nospaces = help = \