diff options
author | Christian Pointner <equinox@helsinki.at> | 2018-11-07 11:01:29 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2018-11-07 11:01:29 (GMT) |
commit | fb90864a19f2b834ce8ba5773dc0a6aed9e0f11e (patch) | |
tree | dc91519fd928d6bb30bc57961aedb883aa941fb3 /openwrt/rhctl/files/rhctl-usbserial.hotplug | |
parent | 6c552b607e8c1a175ae26e90b9637836dc571ee9 (diff) |
updated openwrt packaging
Diffstat (limited to 'openwrt/rhctl/files/rhctl-usbserial.hotplug')
-rwxr-xr-x | openwrt/rhctl/files/rhctl-usbserial.hotplug | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/openwrt/rhctl/files/rhctl-usbserial.hotplug b/openwrt/rhctl/files/rhctl-usbserial.hotplug deleted file mode 100755 index 8d2f7bc..0000000 --- a/openwrt/rhctl/files/rhctl-usbserial.hotplug +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/sh -# -# Persistent naming for usb serial devices. -# -# Copyright 2013-2014 Christian Pointner <equinox@helsinki.at> -# - -logger="logger -p daemon.info -t rhctl-usbserial" - -idVendor=`echo $PRODUCT | awk -F '/' '{ print($1) }'` -idProduct=`echo $PRODUCT | awk -F '/' '{ print($2) }'` -bcdDevice=`echo $PRODUCT | awk -F '/' '{ print($3) }'` - -if [ "$idVendor" != "403" ] || [ "$idProduct" != "6011" ]; then - exit 0 -fi - -DEVPATH="/sys$DEVPATH" -if [ $ACTION == "add" ]; then - if [ ! -e "$DEVPATH/bInterfaceNumber" ]; then - exit 0 - fi - - PARENT=`dirname "$DEVPATH` - SERIAL=`cat $PARENT/serial` - - if [ "$SERIAL" != $(uci -q get rhctl.@global[0].ftdi_serial) ]; then - exit 0 - fi -fi - -hotplug=/dev/.hotplug -token=$hotplug/`echo $PRODUCT$DEVPATH | sed 's/\//=/g'` - -case "$ACTION" in - add) - ttydir=`echo "$DEVPATH/ttyUSB*` - tty=`basename $ttydir` - interface=`cat "$DEVPATH/bInterfaceNumber"` - - device="$interface" - - case "$interface" in - 00) device="ttyMasterCtl" - ;; - 01) device="ttyMasterHB" - ;; - 02) device="ttyStandbyCtl" - ;; - 03) device="ttyStandbyHB" - ;; - *) exit 0 - ;; - esac - - mkdir -p "$hotplug" - rm -f "/dev/$device" "$token" - ln -s "/dev/$device" "$token" - ln -s "/dev/$tty" "/dev/$device" - $logger "added: tty=$tty device=$device" - ;; - remove) - if [ -h "$token" ]; then - device=$(ls -l $token | sed 's/.*-> //;/ /s/.*//') - case "$device" in - "") # no symlink - $logger "failed: token=$token device=$device" - ;; - *) - rm -f $token $device - $logger "removed: $device" - ;; - esac - fi - ;; -esac - -exit 0 |