From 01f0c60e72fcd6bd2dc29fa95d266935b4074269 Mon Sep 17 00:00:00 2001 From: Jakob Olsson Date: Tue, 12 Jun 2018 10:32:09 +0200 Subject: [PATCH] add hotplug scripts, hash update --- libmobile/Makefile | 2 +- libmobile/files/etc/hotplug.d/iface/99-mdmngr | 10 +++++++ libmobile/files/etc/hotplug.d/usb/99-mdmngr | 26 +++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 libmobile/files/etc/hotplug.d/iface/99-mdmngr create mode 100755 libmobile/files/etc/hotplug.d/usb/99-mdmngr diff --git a/libmobile/Makefile b/libmobile/Makefile index cc92a2cbf..77eba4bb7 100644 --- a/libmobile/Makefile +++ b/libmobile/Makefile @@ -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 diff --git a/libmobile/files/etc/hotplug.d/iface/99-mdmngr b/libmobile/files/etc/hotplug.d/iface/99-mdmngr new file mode 100755 index 000000000..fc7662a54 --- /dev/null +++ b/libmobile/files/etc/hotplug.d/iface/99-mdmngr @@ -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 + diff --git a/libmobile/files/etc/hotplug.d/usb/99-mdmngr b/libmobile/files/etc/hotplug.d/usb/99-mdmngr new file mode 100755 index 000000000..17fe077f5 --- /dev/null +++ b/libmobile/files/etc/hotplug.d/usb/99-mdmngr @@ -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 +