From dd18013da376caa4f7a7e1b3373dda1b58ae659f Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Thu, 9 Mar 2023 13:31:23 -0800 Subject: [PATCH] prep for optimization refactor --- install.sh | 6 +++--- lib/skel/.bashrc.d/11-quickinfo.bashrc | 12 ++++++++---- lib/skel/.bashrc.d/11-quickinfo.settings | 5 +++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 291976e..0f227ca 100755 --- a/install.sh +++ b/install.sh @@ -187,9 +187,9 @@ userinstall(){ export prbl_functions="${installdir}/functions" # If all required dependencies are installed, launch initial cache creation - if [[ "$bins_missing" == "false" ]] ; then - bash $HOME/.bashrc.d/11-quickinfo.bashrc -c - fi + #if [[ "$bins_missing" == "false" ]] ; then + # bash $HOME/.bashrc.d/11-quickinfo.bashrc + #fi #clear # Download and install any other extras diff --git a/lib/skel/.bashrc.d/11-quickinfo.bashrc b/lib/skel/.bashrc.d/11-quickinfo.bashrc index 1109705..8cb89ee 100644 --- a/lib/skel/.bashrc.d/11-quickinfo.bashrc +++ b/lib/skel/.bashrc.d/11-quickinfo.bashrc @@ -57,7 +57,8 @@ fi # Locate and import settings (shares same name with script apart from file extension) scriptname="${0##*/}" -rundir_absolute=$(cd `dirname $0` && pwd) +rundir="${0%/*}" +rundir_absolute=$(cd $rundir && pwd) settingsfile=$(echo "$rundir_absolute/$scriptname" | sed -E 's/(.*)bashrc/\1settings/') source $settingsfile @@ -106,8 +107,9 @@ while getopts ":cdh" opt ################################ -[[ "$-" == *i* ]] || fail "non-interactive session" - +#if [[ $interactive_only == true ]] ; then +# [[ "$-" == *i* ]] || fail "non-interactive session" +#fi ################################ # Global parameters pulled from cache file @@ -131,7 +133,9 @@ fi # Gets public IP address using opendns # TODO: optimize this to run after time delay using timestamp in settings -wan_ip=$(wget -qO- http://ipecho.net/plain | xargs echo) +#spinstart & + wan_ip=$(wget -qO- http://ipecho.net/plain | xargs echo) +#spinstop # Checks memory usage mem_usage=$(free -m | grep Mem | awk '{print $3"M/"$2"M"}') diff --git a/lib/skel/.bashrc.d/11-quickinfo.settings b/lib/skel/.bashrc.d/11-quickinfo.settings index 837fcdd..5211267 100644 --- a/lib/skel/.bashrc.d/11-quickinfo.settings +++ b/lib/skel/.bashrc.d/11-quickinfo.settings @@ -1,3 +1,8 @@ +# quickinfo bashrc Preferences + +# Disable run on non-interactive sessions (set true to disable) +interactive_only=false + # Network Adapter Preferences # set false to hide network adapters without valid IP's