Sample Header Ad - 728x90

Calculate checksum for whole content of a device and add a progress bar

1 vote
1 answer
313 views
I want to make a shell script, that lets the user select a mounted device and calculate a checksum for the whole data on this device. I need the checksum to test if the device has been manipulated by somebody else. My approach to this was like the following: #!/bin/bash cd "${0%/*}" device=$(zenity --file-selection --directory \ --filename="/run/media/"${USER}"/" zenity --info \ --title "Info Message" \ --width 500 \ --height 150 \ --text "$(find "$device" -type f -exec md5sum {} \; | sort -k 2 | md5sum | cut -d ' ' -f 1)" **My questions are:** 1) Is this the right approach? 2) How can I add a progress bar between the selection of the device and the dialog box with the output of the calculation?
Asked by stewie (45 rep)
Oct 27, 2022, 11:57 AM
Last activity: Nov 2, 2022, 11:56 AM