From aae93cf92154464fec7e6af8cdcadb813d4aec76 Mon Sep 17 00:00:00 2001 From: James Barnett Date: Mon, 30 Jan 2017 20:10:19 -0600 Subject: [PATCH] notify when disk not mounted --- bin/snap-sync | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/snap-sync b/bin/snap-sync index 445281b..0834e1f 100755 --- a/bin/snap-sync +++ b/bin/snap-sync @@ -115,6 +115,10 @@ fi if [[ "$disk" == -1 ]]; then if [[ "$disk_count" == 0 && "$uuid_cmdline" != "none" ]]; then printf "ERROR: A device with UUID $uuid_cmdline was not found to be mounted, or it is not a BTRFS device.\n" + for u in $(users); do + notify_cmd="sudo -u $u DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(sudo -u $u id -u)/bus notify-send" + $notify_cmd -a snap-sync 'Error' 'No disk with '$uuid_cmdline' mounted.' --icon=dialog-error + done fi printf "Select a mounted BTRFS device to backup to.\n" while [[ $disk -lt 0 || $disk -gt $i ]]; do