3333# ### Variables
3434# #######################################################################
3535# Versioning
36- version=" Version: 02.00-03 , Script Date: 2022.10.29 "
36+ version=" Version: 02.00-04 , Script Date: 2022.11.26 "
3737exit_code=0
3838# md5_sum=$(md5sum $sname | sed 's/system.*//g' )
3939arg1=$1
@@ -175,6 +175,7 @@ function CheckArgs()
175175 echo -e " -d or --details Displays more details to Report"
176176 echo -e " Adds more details to GPU,Storage Controller, Sound devices, "
177177 echo -e " and ZFS (if installed)."
178+ echo -e " -r or --refresh Update script to latest version."
178179 nl
179180 echo -e " Parts of the script need elevated permissions (sudo) to get the correct "
180181 echo -e " information from your system, while other parts do not. We have "
@@ -210,6 +211,9 @@ function CheckArgs()
210211 then
211212 detail_level=' -vv'
212213 zfs_detail=0
214+ elif [[ " $arg1 " == " -r" ]] || [[ " $arg1 " == " --refresh" ]]
215+ then
216+ RefreshScript
213217 fi
214218}
215219
@@ -231,6 +235,31 @@ function CheckTypeError() {
231235 unset -v TypeError
232236}
233237
238+ function RefreshScript() {
239+ # Upgrade script in-place
240+ SOURCE=${BASH_SOURCE[0]}
241+
242+ while [ -L " $SOURCE " ]
243+ # resolve $SOURCE until the file is no longer a symlink
244+ do
245+ DIR=$( cd -P " $( dirname " $SOURCE " ) " > /dev/null 2>&1 && pwd )
246+ SOURCE=$( readlink " $SOURCE " )
247+ if [[ $SOURCE != /* ]]
248+ then
249+ SOURCE=$DIR /$SOURCE
250+ fi
251+ done
252+
253+ DIR=$( cd -P " $( dirname " $SOURCE " ) " > /dev/null 2>&1 && pwd )
254+
255+ cd $DIR
256+
257+ wget -N -t 5 -T 10 https://github.com/UbuntuForums/system-info/raw/main/system-info
258+ chmod +x system-info
259+ echo -e " Script was refeshed."
260+ nl
261+ }
262+
234263function CheckDebianBranch()
235264{
236265 # Check if OS is in Debian Branch
@@ -860,11 +889,17 @@ function GetSwap () {
860889function GetUsb()
861890{
862891 # Gets USB information. Called once by Writer().
863- echo -e " ${setansi} ---------- USB Information from 'lsusb -t -v':$ransi "
864- usb_info=$( lsusb -t $detail_level )
865- echo -e " $usb_info "
892+ # Check condition added for IBM System 390.
893+ if [ -d /sys/bus/usb/devices ]
894+ then
895+ echo -e " ${setansi} ---------- USB Information from 'lsusb -t -v':$ransi "
896+ usb_info=$( lsusb -t $detail_level )
897+ echo -e " $usb_info "
898+ else
899+ echo " System does not have USB devices."
900+ fi
866901 nl
867- unset -v usb_info
902+ unset -v usb_info
868903}
869904
870905function GetNetworkingInfo()
@@ -1076,7 +1111,7 @@ function GetZfsInfo()
10761111{
10771112 zfs_part_type=$( sudo fdisk -l 2>&1 | \
10781113 sed ' /\/dev\/loop/,+3 d' 2> /dev/null | \
1079- uniq | grep -m 1 ' Solaris root\|Solaris boot ' ) # Local Var
1114+ uniq | grep -m 1 ' Solaris\|FreeBSD ' ) # Local Var
10801115 zfs_fs_type=$( df -hT -x tmpfs -x devtmpfs | \
10811116 grep -v ' /snap/' | \
10821117 grep -m 1 ' rpool' ) # Local Var
@@ -1588,6 +1623,9 @@ function GetHweRange() {
15881623 (" 22.10" )
15891624 LTS_PKG=" 22.04"
15901625 ;;
1626+ (" 23.04" )
1627+ LTS_PKG=" 22.04"
1628+ ;;
15911629 (* )
15921630 echo -e " Something went wrong. LTS Edition out of HWE support range."
15931631 esac
@@ -1948,6 +1986,12 @@ function MessageLess()
19481986 SensitiveDataWarning
19491987 }
19501988
1989+ function MessageWait()
1990+ {
1991+ echo -e " Processing Report. This may take about 30 seconds."
1992+ nl
1993+ }
1994+
19511995function SensitiveDataWarning()
19521996{
19531997 echo -e " $redback --- SENSITIVE DATA WARNING --- $resetvid "
@@ -2385,9 +2429,11 @@ CheckTypeError
23852429CheckPrerequisites
23862430# # Report
23872431UserInput
2432+ MessageWait
23882433Writer less | \
23892434 less -R # writing to less
23902435# # Post processing
2436+ MessageWait
23912437RmOldReport
23922438# RestorePath ## This needed if we ever get CheckPath() working
23932439Writer | \
@@ -2402,6 +2448,7 @@ Paster
24022448# # Optional - Archive Report if size larger than 19.5k
24032449ArchiveReport
24042450ResetLocale
2451+ Pause # # Put in to pause before exit, when using a file manager to run script.
24052452exit $exit_code
24062453
24072454
0 commit comments