Mohammad_Faraji
6 months ago
1 changed files with 16 additions and 0 deletions
@ -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…
Reference in new issue