From 6d4dee3aff460c92735ab32972e6dd96d2a64401 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 26 Jun 2018 08:28:29 +0200 Subject: scripts: add an example usb-serial script for hotplug This one automatically creates /dev/tty-node1 for a matching serial. --- scripts/10-usb-serial.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/10-usb-serial.sh diff --git a/scripts/10-usb-serial.sh b/scripts/10-usb-serial.sh new file mode 100644 index 0000000..01ffa39 --- /dev/null +++ b/scripts/10-usb-serial.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# Maps USB serial devices to /dev entries based on vendor, product and serial. + +# usage: $0 {add|remove} +# uses $SUBSYSTEM, $DEVPATH, $DEVNAME +# for add, uses $HP_VENDOR, $HP_PRODUCT, $HP_SERIAL +# returns the name of a link to create on add, and the name of files to +# look for on remove. + +case "$1:$SUBSYSTEM:$HP_VENDOR:$HP_PRODUCT:$HP_SERIAL" in + remove:tty:*:*:*) echo "tty-node*" ;; + add:tty:0403:6015:DJ00JRHF) echo "tty-node1" ;; +esac -- 1.7.12.1