From 693fbc6b0272494ba65cc918abcff34ed12e46ae Mon Sep 17 00:00:00 2001 From: IgnorantGuru Date: Mon, 28 May 2012 09:45:36 -0600 Subject: [PATCH] [devmon 1.1.1] use pmount ahead of udisks; test executables --- ChangeLog | 1 + src/devmon | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7321e9..165f8c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ allow unmount removed devices [devmon 1.1.1] unmount removed devices if mounted mounted messages to stdout instead of stderr + [devmon 1.1.1] use pmount ahead of udisks; test executables 0.2.3 2012-05-27: create /run/media/$USER on demand; add configure --with-setfacl-prog corrected Arch Linux udevil-git AUR package overwriting udevil.conf diff --git a/src/devmon b/src/devmon index 1de3eb3..010867f 100755 --- a/src/devmon +++ b/src/devmon @@ -304,37 +304,37 @@ udisks1=`which udisks` udisks2=`which udisksctl` pmount=`which pmount` -if [ "$udevil" != "" ]; then +if [ "$udevil" != "" ] && [ -x "$udevil" ]; then info_cmd="$udevil" -elif [ "$udisks1" != "" ]; then +elif [ "$udisks1" != "" ] && [ -x "$udisks1" ]; then info_cmd="$udisks1" else - echo "WARNING: devmon can't find udevil or udisks v1 for device monitoring" 1>&2 + echo "WARNING: devmon can't run udevil or udisks v1 for device monitoring" 1>&2 info_cmd="udevil" fi -if [ "$udevil" != "" ]; then +if [ "$udevil" != "" ] && [ -x "$udevil" ]; then if [ -u "$udevil" ] || [ "$(whoami)" = "root" ]; then mount_cmd="$udevil" fi fi -if [ "$mount_cmd" = "" ] && [ "$udisks1" != "" ]; then - mount_cmd="$udisks1" -fi - -if [ "$mount_cmd" = "" ] && [ "$udisks2" != "" ]; then - mount_cmd="$udisks2" -fi - -if [ "$mount_cmd" = "" ] && [ "$pmount" != "" ]; then +if [ "$mount_cmd" = "" ] && [ "$pmount" != "" ] && [ -x "$pmount" ]; then if [ -u "$pmount" ] || [ "$(whoami)" = "root" ]; then mount_cmd="$pmount" fi fi +if [ "$mount_cmd" = "" ] && [ "$udisks1" != "" ] && [ -x "$udisks1" ]; then + mount_cmd="$udisks1" +fi + +if [ "$mount_cmd" = "" ] && [ "$udisks2" != "" ] && [ -x "$udisks2" ]; then + mount_cmd="$udisks2" +fi + if [ "$mount_cmd" = "" ]; then - echo "WARNING: devmon can't run udevil, udisks, or pmount for mounting" 1>&2 + echo "WARNING: devmon can't run udevil, pmount, or udisks for mounting" 1>&2 mount_cmd="udevil" fi