@@ -405,7 +405,7 @@ class SysInfo {
405405 for path in dmiPat hs {
406406 if (fexists (pa th )) {
407407 fileConte nt = trim (readFile (pa th ))
408- if (!isNull (fileConte nt ) and len (fileConte nt ) > 0 ) {
408+ if (!isNull (fileConte nt ) && len (fileConte nt ) > 0 ) {
409409 mod el = substr (fileConte nt , nl, "" )
410410 return mod el
411411 }
@@ -539,7 +539,7 @@ class SysInfo {
539539
540540 // First get CPU model
541541 for line in lin es {
542- if (substr (li ne , "model name" ) and modelNa me = "" ) {
542+ if (substr (li ne , "model name" ) && modelNa me = "" ) {
543543 colonP os = substr (li ne , ":" )
544544 if (colonP os > 0 ) {
545545 modelNa me = trim (substr (li ne , colonP os + 1 ))
@@ -728,7 +728,7 @@ class SysInfo {
728728 // Initialize shellVersion
729729 shellVersi on = "Unknown"
730730 // Skip version check for sh and dash shells since they don 't suppo rt --versi on
731- if !(she ll [:na me ] = "sh" or she ll [:na me ] = "dash" ) {
731+ if !(she ll [:na me ] = "sh" || she ll [:na me ] = "dash" ) {
732732 // Execute the shell with the version argument to retrieve the shell version
733733 shellVersi on = systemCmd (shellIn fo + " --version" )
734734 }
@@ -843,7 +843,7 @@ class SysInfo {
843843 // Helper function to calculate uptime based on uptimeInfo and the given params list
844844 func calcUptime (uptimeIn fo , para ms ) {
845845 // Set default parameter values if not provid ed , not a list , or the list is empty
846- if (!isList (para ms ) or len (para ms ) = 0 ) {
846+ if (!isList (para ms ) || len (para ms ) = 0 ) {
847847 para ms = [:da ys = 1 , :hou rs = 1 , :minut es = 1 , :secon ds = 1 ]
848848 }
849849
@@ -855,7 +855,7 @@ class SysInfo {
855855 for tUnit in tUni ts {
856856 if (params [tUnit [3 ]] = 1 ) {
857857 val ue = floor (totalSecon ds / tUn it [1 ])
858- if (val ue > 0 or len (fUpti me ) > 0 ) {
858+ if (val ue > 0 || len (fUpti me ) > 0 ) {
859859 if (len (fUpti me ) > 0 ) {
860860 fUpti me += ", "
861861 }
@@ -961,7 +961,7 @@ class SysInfo {
961961 diskSi ze = number (bytesS tr ) / 1024
962962
963963 // Only add if disk name and size are val id
964- if (!isNull (currentDi sk ) and diskSi ze > 0 ) {
964+ if (!isNull (currentDi sk ) && diskSi ze > 0 ) {
965965 add (blockDevic es , [:na me = currentDi sk , :si ze = diskSi ze ])
966966 }
967967
@@ -1027,7 +1027,7 @@ class SysInfo {
10271027 lin es = split (outp ut , nl)
10281028
10291029 for line in lin es {
1030- if (!isNull (li ne ) and len (trim (li ne )) > 0 ) {
1030+ if (!isNull (li ne ) && len (trim (li ne )) > 0 ) {
10311031 // Parse each line of ip addr outp ut
10321032 par ts = split (li ne , " " )
10331033
@@ -1046,7 +1046,7 @@ class SysInfo {
10461046 ipAddre ss = ipPar ts [1 ]
10471047
10481048 // Skip loopback unless it 's the only interface
1049- if (interfaceNa me = "lo" and len (interfac es ) > 0 ) {
1049+ if (interfaceNa me = "lo" && len (interfac es ) > 0 ) {
10501050 loop
10511051 }
10521052
@@ -1095,16 +1095,16 @@ class SysInfo {
10951095 if (colonP os > 0 ) {
10961096 potentialNa me = left (trimmed_li ne , colonP os - 1 )
10971097 // Ensure potentialName is a valid interface na me
1098- if (len (potentialNa me ) > 0 and !substr (potentialNa me , " " )) {
1099- if lower (potentialNa me ) != "status" and lower (potentialNa me ) != "media" and lower (potentialNa me ) != "options" and lower (potentialNa me ) != "ether" and lower (potentialNa me ) != "groups" {
1098+ if (len (potentialNa me ) > 0 && !substr (potentialNa me , " " )) {
1099+ if ( lower (potentialNa me ) != "status" && lower (potentialNa me ) != "media" && lower (potentialNa me ) != "options" && lower (potentialNa me ) != "ether" && lower (potentialNa me ) != "groups" ) {
11001100 isInterfaceLi ne = true
11011101 }
11021102 }
11031103 }
11041104 }
11051105
11061106 if (isInterfaceLi ne ) {
1107- if (!isNull (currentInterfa ce ) and !isNull (current IP )) {
1107+ if (!isNull (currentInterfa ce ) && !isNull (current IP )) {
11081108 add (interfac es , [
11091109 :na me = currentInterfa ce ,
11101110 :ip = current IP ,
@@ -1116,7 +1116,7 @@ class SysInfo {
11161116 currentInterfa ce = left (trimmed_li ne , colonP os - 1 )
11171117 current IP = ""
11181118
1119- elseif (!isNull (currentInterfa ce ) and (substr (trimmed_li ne , "inet " ) or substr (trimmed_li ne , "inet addr:" )))
1119+ elseif (!isNull (currentInterfa ce ) && (substr (trimmed_li ne , "inet " ) || substr (trimmed_li ne , "inet addr:" )))
11201120 ipLineConte nt = ""
11211121 if (substr (trimmed_li ne , "inet addr:" )) {
11221122 ipLineConte nt = trim (substr (trimmed_li ne , substr (trimmed_li ne , "inet addr:" ) + len ("inet addr:" )))
@@ -1133,15 +1133,15 @@ class SysInfo {
11331133 temp IP = ipLineConte nt
11341134 }
11351135
1136- if (!substr (temp IP , ":" ) and current IP = "" ) {
1136+ if (!substr (temp IP , ":" ) && current IP = "" ) {
11371137 current IP = temp IP
11381138 }
11391139 }
11401140 }
11411141 }
11421142
11431143 // Add the last interface fou nd , if it has an IP
1144- if (!isNull (currentInterfa ce ) and !isNull (current IP )) {
1144+ if (!isNull (currentInterfa ce ) && !isNull (current IP )) {
11451145 add (interfac es , [
11461146 :na me = currentInterfa ce ,
11471147 :ip = current IP ,
0 commit comments