From 845785be8ed2e8834f968370f9607519d76690d6 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Fri, 14 Jun 2013 19:14:00 +0000 Subject: [PATCH] branch one, fine tuning some config file overrides, moved the sourcing of configs to right under initialize so values set there and used right after can be overridden prior to the next tests. --- inxi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/inxi b/inxi index 883813e..f7ffe50 100755 --- a/inxi +++ b/inxi @@ -3,7 +3,7 @@ #### Script Name: inxi #### Version: 1.9.8 #### Date: June 14 2013 -#### Patch Number: 02-b1 +#### Patch Number: 03-b1 ######################################################################## #### SPECIAL THANKS ######################################################################## @@ -247,9 +247,6 @@ A_X_DATA='' # -U and -! testing/advanced update options, as well as removing the -U help menu item B_ALLOW_UPDATE='true' B_ALLOW_WEATHER='true' -# this handles a fringe case where $DISPLAY is not null even though out of X, for headless -# server use only, change in inxi.conf file to 'false' -B_DO_X_CHECK='true' ## standard boolean flags ## B_BSD_RAID='false' B_COLOR_SCHEME_SET='false' @@ -594,6 +591,16 @@ main() # This function just initializes variables initialize_data + + # Source global config overrides, needs to be here because some things + # can be reset that were set in initialize, but check_required_apps needs + if [[ -s /etc/$SCRIPT_NAME.conf ]];then + source /etc/$SCRIPT_NAME.conf + fi + # Source user config variables override /etc/inxi.conf variables + if [[ -s $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ]];then + source $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf + fi # Check for dependencies BEFORE running ANYTHING else except above functions # Not all distro's have these depends installed by default. Don't want to run @@ -607,14 +614,7 @@ main() SCRIPT_VERSION_NUMBER=$( parse_version_data 'main' ) SCRIPT_PATCH_NUMBER=$( parse_version_data 'patch' ) - ### Source global config overrides - if [[ -s /etc/$SCRIPT_NAME.conf ]];then - source /etc/$SCRIPT_NAME.conf - fi - # Source user config variables override /etc/inxi.conf variables - if [[ -s $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf ]];then - source $HOME/.$SCRIPT_NAME/$SCRIPT_NAME.conf - fi + # previous source location, check for bugs ## this needs to run before the KONVI stuff is set below ## Konversation 1.2 apparently does not like the $PPID test in get_start_client @@ -802,7 +802,7 @@ initialize_data() B_SCSI_FILE='true' fi - if [[ -n $DISPLAY && $B_DO_X_CHECK == 'true' ]];then + if [[ -n $DISPLAY ]];then B_SHOW_X_DATA='true' B_RUNNING_IN_X='true' fi