diff --git a/inxi b/inxi index e161877..aeaf73e 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.85 +#### version: 1.4.86 #### Date: April 26 2011 ######################################################################## #### SPECIAL THANKS @@ -905,16 +905,18 @@ select_default_color_scheme() ;; esac set_color_scheme $user_selection - if [[ ! -f $config_file || -z $( grep -s "$config_variable=" $config_file ) ]];then + # make file/directory first if missing + if [[ ! -f $config_file ]];then if [[ ! -d $HOME/.$SCRIPT_NAME ]];then mkdir $HOME/.$SCRIPT_NAME fi touch $config_file + fi + if [[ -z $( grep -s "$config_variable=" $config_file ) ]];then print_screen_output "Creating and updating config file for $COLOR_SELECTION color scheme now..." echo "$config_variable=$user_selection" >> $config_file else print_screen_output "Updating config file for $COLOR_SELECTION color scheme now..." - touch $config_file # just in case of logic error above sed -i "s/$config_variable=.*/$config_variable=$user_selection/" $config_file fi # file exists now so we can go on to cleanup