Skip to content
Snippets Groups Projects
Commit 981870c6 authored by Jakob Olsson's avatar Jakob Olsson
Browse files

remove dongle_hotplug dependency on some bool-file, different static approach

parent f2bbe516
Branches
Tags
No related merge requests found
#echo "DEVTYPE - $DEVTYPE " > /dev/console #echo "DEVTYPE - $DEVTYPE " > /dev/console
#echo "DEVPATH - $DEVPATH " > /dev/console #echo "DEVPATH - $DEVPATH " > /dev/console
DEV_MOUNTPATH=`echo "$DEVPATH" | cut -d'/' -f 1-7`
if [ "$ACTION" == "remove" ]; then JUNK=`echo "$DEVPATH" | cut -d'/' -f 8`
#echo "tmp file removed!" > /dev/console #echo "dev_path: $DEVPATH" > /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 #echo "dongle path: $DEV_MOUNTPATH" > /dev/console
#echo "JUNK: $JUNK" > /dev/console
case "$ACTION" in case "$ACTION" in
add) add)
ubus call dongle alert '{"path":"/sys'${DEV_MOUNTPATH}'"}' if [ -z "$JUNK" ];then
echo "ubus call dongle alert '{\"path\":\"/sys$DEV_MOUNTPATH\"}'" > /dev/console ubus call dongle alert '{"path":"/sys'${DEV_MOUNTPATH}'"}'
touch /tmp/donglehotplug echo "ubus call dongle alert '{\"path\":\"/sys$DEV_MOUNTPATH\"}'" > /dev/console
;; touch /tmp/donglehotplug
remove) fi
echo "dongle removed!" ;;
;; remove)
*) echo "dongle removed!"
echo "Action: Neither add nor remove" > /dev/console ubus call dongle update
;; ;;
*)
echo "Action: Neither add nor remove" > /dev/console
;;
esac esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment