Skip to content
Snippets Groups Projects
Commit aa4bdd9f authored by Arun Muthusamy's avatar Arun Muthusamy
Browse files

update hotplug to avoid multiple occurrence of ubus add call

parent 509b32c6
No related branches found
No related tags found
No related merge requests found
echo "DEVTYPE - $DEVTYPE " > /dev/console
echo "DEVPATH - $DEVPATH " > /dev/console
echo "ACTION - $ACTION " > /dev/console
#echo "SEQUNUM - $SEQNUM " > /dev/console
#echo "SUBSYSTEM - $SUBSYSTEM " > /dev/console
#echo "DEVTYPE - $DEVTYPE " > /dev/console
#echo "DEVPATH - $DEVPATH " > /dev/console
if [ "$ACTION" == "remove" ]; then
#echo "tmp file removed!" > /dev/console
rm -r /tmp/donglehotplug
fi
if [[ -f /tmp/donglehotplug ]] ; then
#echo "File exists" > /dev/console
exit
fi
DEV_MOUNTPATH=`echo "$DEVPATH" | cut -d'/' -f 1-6`
#echo "dongle path: $DEV_MOUNTPATH" > /dev/console
DEV_MOUNTPATH=`echo "/devices/platform/ehci-platform.0/usb3/3-2/3-2:1.0" | cut -d'/' -f 1-6`
echo "dongle path: $DEV_MOUNTPATH" > /dev/console
case "$ACTION" in
add)
ubus call dongle alert '{"path":"/sys'${DEV_MOUNTPATH}'"}'
echo "ubus call dongle alert '{\"path\":\"/sys$DEV_MOUNTPATH\"}'" > /dev/console
;;
remove)
echo "dongle removed!"
;;
*)
echo "Action: Neither add nor remove" > /dev/console
;;
esac
add)
ubus call dongle alert '{"path":"/sys'${DEV_MOUNTPATH}'"}'
echo "ubus call dongle alert '{\"path\":\"/sys$DEV_MOUNTPATH\"}'" > /dev/console
touch /tmp/donglehotplug
;;
remove)
echo "dongle removed!"
;;
*)
echo "Action: Neither add nor remove" > /dev/console
;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment