Browse Source

Add usb-storage-action on usb directory

usb-socket
Mohammad_Faraji 6 months ago
parent
commit
fed494020f
  1. 16
      src/scripts/utils/usb/usb-storage-action

16
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
Loading…
Cancel
Save