K
K
Kamikaze10242017-01-30 14:09:41
linux
Kamikaze1024, 2017-01-30 14:09:41

How to run a script after connecting a flash drive?

Good afternoon! Mdev does not execute a script when a flash drive is connected (usbUnplug.sh). What could be the reason? The flash drive itself is correctly defined as /dev/sda1. This node appears when connected and is removed when the flash drive is pulled out. Those. mdev works. The config is stored in /etc/init.d/rcS. What could be the reason?
mdev config:

#!/bin/sh

mount -t proc none /proc
mount -t sysfs sysfs /sys
mount -t ramfs none /tmp

#run mount script when usb hotplugged
/dev/sda1 0:0 660 @/userScripts/usbPlug.sh

#run umount script when usb hotunplugged
#sda[0-9]* root:disk 660 */userScripts/usbUnplug.sh

echo > /dev/mdev.seq
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s

syslogd -s10240 -f/etc/syslog.conf

modprobe 8188eu
modprobe nuc970_lcd_matrix_ctrl

ifconfig lo up
# ifconfig eth0 up
# udhcpc -i eth0 &
# ifconfig wlan0 up

chmod 666 /dev/null
mkdir /dev/pts
mount -t devpts devpts /dev/pts

dropbear
/usr/bin/cash fiscat &

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin ™, 2017-01-30
@Energoblock

What problem are you trying to solve?
Can I execute a script through udev when a USB flash drive is connected?
Running script via udev

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question