From 59fecbc965175b40b7f37404c916055942ecf9aa Mon Sep 17 00:00:00 2001 From: IgnorantGuru Date: Sun, 26 Apr 2015 10:48:03 -0600 Subject: [PATCH] [devmon 1.1.8] improve --exec-on-unmount for mounted during startup [devmon 1.1.8] unset %d %l for --exec-on-unmount #56 This change will make --exec-on-unmount commands run for devices mounted automatically during devmon startup (but still not for devices mounted before devmon was started).. --- ChangeLog | 2 ++ src/devmon | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index b073690..c3e0ecd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 0.4.3+ udevil.conf use nonempty option for exfat #52 [devmon 1.1.8] fix no error popup on --unmount-removable #42 + [devmon 1.1.8] improve --exec-on-unmount for mounted during startup + [devmon 1.1.8] unset %d %l for --exec-on-unmount #56 0.4.3 2013-12-09: fix default udevil.conf allowed_options missing fmask=0133 #35 0.4.2 2013-12-04: diff --git a/src/devmon b/src/devmon index 74d3fcd..bcdcda4 100755 --- a/src/devmon +++ b/src/devmon @@ -568,6 +568,13 @@ mountdev() # $1=device [$2=label] [$3=devtype or fstype] # no filesystem reported but successful mount echo "$mntmsg" fi + + # set devtag for recognizing mounted by devmon + devpath="$1" + devtag="${devpath#/dev/}" + devtag="${devtag//-/_}" + eval devmounted${devtag}=1 + echo "$umsg" if [ "$point" = " " ]; then # pmount doesn't output the mount point - get it now @@ -1167,6 +1174,7 @@ while ps -p $COPROC_PID &>/dev/null; do if (( execoux != 0 )); then if ( ! ignoredevice "$devpath" ) && \ ( ! ignorelabel "$label" ); then + unset lb point dv="$devpath" execcommands "exec on unmount" "${execou[@]}" fi