Skip to content

Commit

Permalink
Closes #4 - Print some config settings with "show" command
Browse files Browse the repository at this point in the history
  • Loading branch information
lfkeitel committed Dec 16, 2015
1 parent 7b8fe46 commit 96c42ad
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions sysreport
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ echoError() {
>&2 echo -e "$1"
}

CONFFILE=""

# Import server specific configuration
if [ -f "$DIR/sysreporter.conf" ]; then
source "$DIR/sysreporter.conf"
CONFFILE="$DIR/sysreporter.conf"
elif [ -f /etc/sysreporter/sysreporter.conf ]; then
source /etc/sysreporter/sysreporter.conf
CONFFILE="/etc/sysreporter/sysreporter.conf"
else
echoError "No configuration file found"
exit 1
Expand Down Expand Up @@ -80,10 +84,19 @@ cmd_show() {
done
cd "$DIR"

echo "Enabled:"
echo "Configuration:"
echo "Conf File: $CONFFILE"
echo "Reports Dir: $REPORTSDIR"
echo "Servername: $SERVERNAME"
echo "Title: $TITLE"
echo "Email: $EMAIL_REPORT"
echo "Emails: $EMAIL_TO"
echo "Command Timeout: $CMDTIMEOUT seconds"
echo
echo "Enabled Reports:"
for f in "${ENABLED_ARR[@]}"; do echo "$f"; done
echo
echo "Disabled:"
echo "Disabled Reports:"
for f in "${DISABLED_ARR[@]}"; do echo "$f"; done
}

Expand Down

0 comments on commit 96c42ad

Please sign in to comment.