diff --git a/src/scripts/utils/usb/usb-storage-action b/src/scripts/utils/usb/usb-storage-action new file mode 100644 index 0000000..732403e --- /dev/null +++ b/src/scripts/utils/usb/usb-storage-action @@ -0,0 +1,16 @@ +#!/bin/bash + +# Get the device name from the udev rule +DEVICE_NAME=$1 + +# Mount the device +udisksctl mount -b "$DEVICE_NAME" + +# Check if the mount was successful +if [ $? -eq 0 ]; then + # Define the socket path + SOCKET_PATH="/tmp/usb-Sono-Socket.socket" + + # Write a message to the socket + echo "USB storage device connected" | socat - UNIX-CONNECT:$SOCKET_PATH + echo "USB storage device connected" >> /tmp/tmp.log