Skip to content

Commit

Permalink
bugfixes for (#63) and (#61)
Browse files Browse the repository at this point in the history
- (#63) Fix path to cut(1) command
- (#61) add filter to prevent df reporting "No such device or address" from breaking the script
  • Loading branch information
ironsheep committed Aug 17, 2022
1 parent a521a6f commit 8fbb4f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue, 17 Aug 2022 18:37:21 -0600 v1.6.2

- (#63) Fix path to cut(1) command
- (#61) add filter to prevent df reporting "No such device or address" from breaking the script

Tue, 02 Aug 2022 18:37:21 -0600 v1.6.1

- Fix 'bullseye' name determination - remove extra sources output
Expand Down
11 changes: 10 additions & 1 deletion ISP-RPi-mqtt-daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def getDeviceModel():

def getLinuxRelease():
global rpi_linux_release
out = subprocess.Popen("/bin/cat /etc/apt/sources.list | /bin/egrep -v '#' | /usr/bin/awk '{ print $3 }' | /bin/sed -e 's/-/ /g' | /bin/cut -f1 -d' ' | /bin/grep . | /usr/bin/sort -u",
out = subprocess.Popen("/bin/cat /etc/apt/sources.list | /bin/egrep -v '#' | /usr/bin/awk '{ print $3 }' | /bin/sed -e 's/-/ /g' | /usr/bin/cut -f1 -d' ' | /bin/grep . | /usr/bin/sort -u",
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
Expand Down Expand Up @@ -651,8 +651,17 @@ def getFileSystemDrives():
# /dev/mmcblk0p1 253 55 198 22% /boot
# tmpfs 340 0 340 0% /run/user/1000

# FAILING Case v1.6.x (issue #61)
# [[/bin/df: /mnt/sabrent: No such device or address',
# '/dev/root 119756 19503 95346 17% /',
# '/dev/sda1 953868 882178 71690 93% /media/usb0',
# '/dev/sdb1 976761 93684 883078 10% /media/pi/SSD']]

tmpDrives = []
for currLine in trimmedLines:
if 'no such device' in currLine.lower():
print_line('BAD LINE FORMAT, Skipped=[{}]'.format(currLine), debug=True, warning=True)
continue
lineParts = currLine.split()
print_line('lineParts({})=[{}]'.format(
len(lineParts), lineParts), debug=True)
Expand Down

0 comments on commit 8fbb4f1

Please sign in to comment.