Skip to content

Commit 76a1152

Browse files
Email Notification when USB Drive Unmount Fails
Added an email notification when unmounting the USB-attached drive fails after trying for 4 minutes.
1 parent 0ba5af2 commit 76a1152

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

MerlinAU.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -u
1010

1111
## Set version for each Production Release ##
1212
readonly SCRIPT_VERSION=1.5.7
13-
readonly SCRIPT_VERSTAG="25111002"
13+
readonly SCRIPT_VERSTAG="25111020"
1414
readonly SCRIPT_NAME="MerlinAU"
1515
## Set to "master" for Production Releases ##
1616
SCRIPT_BRANCH="dev"
@@ -3000,9 +3000,9 @@ _GetLatestFWUpdateVersionFromRouter_()
30003000
echo "$newVersionStr" ; return "$retCode"
30013001
}
30023002

3003-
##------------------------------------------##
3004-
## Modified by ExtremeFiretop [2025-Jun-17] ##
3005-
##------------------------------------------##
3003+
##----------------------------------------##
3004+
## Modified by Martinski W. [2025-Nov-10] ##
3005+
##----------------------------------------##
30063006
_CreateEMailContent_()
30073007
{
30083008
if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi
@@ -3080,6 +3080,13 @@ _CreateEMailContent_()
30803080
printf "\nThe F/W version that is currently installed:\n<b>${fwInstalledVersion}</b>\n"
30813081
} > "$tempEMailBodyMsg"
30823082
;;
3083+
FAILED_USB_DRIVE_UNMOUNT)
3084+
emailBodyTitle="USB Drive Unmount Failed"
3085+
{
3086+
echo "Unable to unmount the USB-attached drive before the F/W Update flash was started on the <b>${MODEL_ID}</b> router."
3087+
printf "\nThe USB drive was likely in a busy state.\n"
3088+
} > "$tempEMailBodyMsg"
3089+
;;
30833090
SUCCESS_SCRIPT_UPDATE_STATUS)
30843091
if [ -s "$SCRIPT_VERPATH" ]
30853092
then
@@ -8842,6 +8849,7 @@ _Unmount_Eject_USB_Drives_()
88428849
else
88438850
_MsgToSysLog_ "$logMsg Wait Timeout [$maxWaitDelaySecs secs] expired."
88448851
_MsgToSysLog_ "Unable to unmount USB drive. Device is likely busy."
8852+
_SendEMailNotification_ FAILED_USB_DRIVE_UNMOUNT
88458853
fi
88468854
_MsgToSysLog_ "END of ${logMsg}."
88478855

0 commit comments

Comments
 (0)