add hotplug scripts, hash update

This commit is contained in:
Jakob Olsson 2018-06-12 10:32:09 +02:00
parent 94ecc5f614
commit 01f0c60e72
3 changed files with 37 additions and 1 deletions

View file

@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=libmobile
PKG_VERSION:=0.1
PKG_SOURCE_VERSION:=25051135208bdbabc6c42216da791919971c4e92
PKG_SOURCE_VERSION:=74645bced6e0d883098c45bb6bdcc89bdf85d979
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git@public.inteno.se:mobile-api.git

View file

@ -0,0 +1,10 @@
if echo $DEVICE | grep "eth";then
#echo "time to update due to eth!" > /dev/console
ubus call dongle update
fi
if echo $DEVICE | grep "usb";then
#echo "time to update due to usb!" > /dev/console
ubus call dongle update
fi

View file

@ -0,0 +1,26 @@
#echo "DEVTYPE - $DEVTYPE " > /dev/console
#echo "DEVPATH - $DEVPATH " > /dev/console
DEV_MOUNTPATH=`echo "$DEVPATH" | cut -d'/' -f 1-7`
JUNK=`echo "$DEVPATH" | cut -d'/' -f 8`
#echo "dev_path: $DEVPATH" > /dev/console
#echo "dongle path: $DEV_MOUNTPATH" > /dev/console
#echo "JUNK: $JUNK" > /dev/console
case "$ACTION" in
add)
if [ -z "$JUNK" ];then
ubus call dongle alert '{"path":"/sys'${DEV_MOUNTPATH}'"}'
#echo "ubus call dongle alert '{\"path\":\"/sys$DEV_MOUNTPATH\"}'" > /dev/console
touch /tmp/donglehotplug
fi
;;
remove)
#echo "dongle removed!"
ubus call dongle update
;;
*)
#echo "Action: Neither add nor remove" > /dev/console
;;
esac