Skip to content
Snippets Groups Projects
Commit 84627d48 authored by Bob Mottram's avatar Bob Mottram
Browse files

Copy usb canary image to syncthing if it is installed

parent 8788d5a1
No related branches found
No related tags found
No related merge requests found
......@@ -88,9 +88,6 @@ if [[ "$SUBJECT" == *"$canary_subject"* ]]; then
rm $notification_image_filename
fi
fswebcam -d /dev/video1 --jpeg 50 -D 1 $notification_image_filename
if [ -f $notification_image_filename ]; then
image_extra="-A $notification_image_filename"
fi
else
# Otherwise use the built-in camera
if [ -f /dev/video0 ]; then
......@@ -98,13 +95,18 @@ if [[ "$SUBJECT" == *"$canary_subject"* ]]; then
rm $notification_image_filename
fi
fswebcam -d /dev/video0 --jpeg 50 -D 1 $notification_image_filename
if [ -f $notification_image_filename ]; then
image_extra="-A $notification_image_filename"
fi
fi
fi
fi
fi
if [ -f $notification_image_filename ]; then
image_extra="-A $notification_image_filename"
# If syncthing is installed then copy the image to the admin
if [ -d "/home/$ADMIN_USERNAME/Sync" ]; then
cp $notification_image_filename "/home/$ADMIN_USERNAME/Sync/usb_canary.jpg"
fi
fi
# send email to administrator
if [ "$SUBJECT" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment