#!/bin/bash

# Reads variables as though we ran `source $1`, without running any shell code in the file.
# If there is shell code in the file, this might end up setting some weird variables.
# don't run this against anything except fusion-sys.cfg
function nagios_source_vars() {

	local keys=`cat $1 | cut -f1 -d=`
	local values=`cat $1 | cut -f2 -d=`
	local idx=0

	for key in $keys; do
	    local idx=$((idx+1));
	    local value=`echo $values | cut -f$idx -d' '`;
	    eval $key=$value; 
	done
}