Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitting out integrity-check function to subscript.
- Loading branch information
1 parent
bc79205
commit 99d761a
Showing
2 changed files
with
29 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
#set -e | ||
|
||
integrity_check () | ||
{ | ||
media_mountpoint="${1}" | ||
|
||
log_begin_msg "Checking media integrity" | ||
|
||
cd ${media_mountpoint} | ||
/bin/md5sum -c md5sum.txt < /dev/tty8 > /dev/tty8 | ||
RC="${?}" | ||
|
||
log_end_msg | ||
|
||
if [ "${RC}" -eq 0 ] | ||
then | ||
log_success_msg "Everything ok, will reboot in 10 seconds." | ||
sleep 10 | ||
cd / | ||
umount ${media_mountpoint} | ||
sync | ||
echo u > /proc/sysrq-trigger | ||
echo b > /proc/sysrq-trigger | ||
else | ||
panic "Not ok, a media defect is likely, switch to VT8 for details." | ||
fi | ||
} |