Skip to content

Commit 34de849

Browse files
committed
Fixed message line breaks in CheckPrerequisites().
1 parent 62d55d8 commit 34de849

File tree

1 file changed

+40
-17
lines changed

1 file changed

+40
-17
lines changed

system-info

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#### Variables
3434
########################################################################
3535
# Versioning
36-
version="Version: 01.00-02, Script Date: 2021.12.04"
36+
version="Version: 01.00-02, Script Date: 2021.12.06"
3737
#md5_sum=$(md5sum $sname | sed 's/system.*//g' )
3838
arg1=$1
3939
arg2=$2
@@ -220,16 +220,17 @@ function CheckPrerequisites()
220220
# a useful option to see if there "is" a SecureBoot option in the BIOS, besides just what it is set at. This, during
221221
# tests, is safe to install on Legacy Only BIOS systems and can be used to tell if the BIOS is such.
222222
echo -e "$faintvid \"${Program}\" Could not be found. This program is suggested.$resetvid"
223-
echo -e "$faintvid If this is older hardware that is 'Legacy Only BIOS', then this can be ignored.$resetvid"
224-
echo -e "$faintvid The report will still run without it. It will just not be able to answer one question. $resetvid"
223+
echo -e "$faintvid If this is older hardware that is 'Legacy Only BIOS', then this can be $resetvid"
224+
echo -e "$faintvid ignored. The report will still run without it. It will just not be able $resetvid"
225+
echo -e "$faintvid to answer one question. $resetvid"
225226
check_mokutil=0; # Set Flag to false and recheck in GetSb()
226227
check_prog=0;
227228
missing_programs="$missing_programs\n$Program"
228229
debug "'$Program' is not installed" 1
229230
elif [[ "$Program" == "pastebinit" ]] || [[ "$Program" == "wget" ]] || [[ "$Program" == "curl" ]] || [[ "$Program" == "nc" ]]
230231
then
231232
check_prog=0;
232-
check_paster=$($check_paster+1);
233+
check_paster=$((check_paster+1));
233234
missing_paster_progs="$missing_paster_progs$Program, "
234235
missing_programs="$missing_programs\n$Program"
235236
else
@@ -247,11 +248,12 @@ function CheckPrerequisites()
247248
echo -e "The Script 'system-info' uses some very basic Linux utilities. "
248249
echo -e "Some of these utilities were not found."
249250
nl
250-
echo -e "The report will still run without them. It will just not answer related questions."
251-
echo -e "Some of that information may be related to the diagnosis of your installed system."
252-
echo -e "If missing utilities may have answered your specified problem, you may "
253-
echo -e "be asked by a 'Ubuntu Forums Member' supporting you if a program was missing, and "
254-
echo -e "if you could install it to answer that related question."
251+
echo -e "The report will still run without them. It will just not answer related "
252+
echo -e "questions. Some of that information may be related to the diagnosis of "
253+
echo -e "your installed system. If missing utilities may have answered your "
254+
echo -e "specified problem, you may be asked by a 'Ubuntu Forums Member' supporting "
255+
echo -e "you if a program was missing, and if you could install it to answer that "
256+
echo -e "related question."
255257
nl
256258
CheckPaster
257259
echo -e "Some of these utilities are not default installed utilities to all Editions, "
@@ -267,7 +269,7 @@ function CheckPrerequisites()
267269
if [[ $ans =~ ^[Ee]$ ]]
268270
then
269271
echo -e "Please install the missing programs listed above before rerunning script."
270-
exit
272+
exit 1
271273
elif [[ ${ans,} =~ ^[Cc]$ ]]
272274
then
273275
echo -e "Some task(s) will not work, but I'll do the best possible, continuing ..."
@@ -510,17 +512,17 @@ function GetNetworkingInfo()
510512
function GetInternetStatus()
511513
{
512514
# Verifies ping status and relsolv. Called once by GetNetworkingInfo().
513-
ping -c 1 www.google.com > /dev/null
515+
ping -c 1 www.google.com &> /dev/null
514516
pingStatus=$?
515517
echo -e " --- Internet Connection Status from 'ping [various addresses]' --- "
516518
if [ $pingStatus == 0 ]
517519
then
518520
echo -e "Connected to Internet with DNS"
519521
else
520522
echo -e "Cannot reach internet by DNS"
521-
ping -c 1 8.8.8.8 > /dev/null
523+
ping -c 1 8.8.8.8 &> /dev/null
522524
pingStatus=$?
523-
if pingStatus [ $pingStatus == 0 ]
525+
if [ $pingStatus == 0 ]
524526
then
525527
echo -e "Can reach the internet without DNS"
526528
else
@@ -533,7 +535,7 @@ function GetInternetStatus()
533535
function GetPingStatus()
534536
{
535537
# Takes arg as IP or URL. Returns psuedo boolean $return_status. Called twice (by Paster() and GetInternetStatus()).
536-
ping -c 1 $1 > /dev/null
538+
ping -c 1 $1 &> /dev/null
537539
pingStatus=$?
538540
if [ $pingStatus == 0 ]
539541
then
@@ -659,9 +661,14 @@ function GetGraphicsEnv()
659661
if [ $DESKTOP_SESSION ]
660662
then
661663
echo -e "The Current Desktop Session is: $DESKTOP_SESSION "
662-
xmode=$(xrandr -q | egrep --color=never -e 'Screen' -e 'connected primary')
663-
echo -e "The Current X Desktop Information Details from 'xrandr' are: "
664-
echo -e "$xmode"
664+
xmode=$(xrandr -q &> /dev/null | egrep --color=never -e 'Screen' -e 'connected ')
665+
if [ $? -eq 1 ]
666+
then
667+
echo -e "'xrandr' could not determine resolution."
668+
else
669+
echo -e "The Current X Desktop Information Details from 'xrandr' are: "
670+
echo -e "$xmode"
671+
fi
665672
else
666673
echo -e "The Current Desktop Session is: <Not Populated> "
667674
fi
@@ -930,8 +937,24 @@ function MessageLess()
930937
echo -e "at the lower left of your screen,"
931938
echo -e "$blueback quit from 'less' to continue the script with the <q> key. $resetvid"
932939
nl
940+
SensitiveDataWarning
933941
}
934942

943+
function SensitiveDataWarning () {
944+
echo -e "$redback --- SENSITIVE DATA WARNING --- $resetvid "
945+
nl
946+
echo -e "This Report is prepared in two versions- "
947+
nl
948+
echo -e "The 'Your Eyes Only' version, only exists temporarily in memory, and is "
949+
echo -e "viewed onscreen by 'less'. The report that is viewed by 'less' onscreen "
950+
echo -e "contains 'sensitive data' that should NOT be posted publically. "
951+
nl
952+
echo -e "The Final Report 'file' is saved to disk as a file. The Final Report is "
953+
echo -e "sanitized, filtered, with the sensitive data removed. It is safe to post "
954+
echo -e "online publically. "
955+
nl
956+
}
957+
935958
function ReportFooter()
936959
{
937960
# End of report (the footer). Called once by Writer().

0 commit comments

Comments
 (0)