jwgorman post at 2024-2-19 06:44:29

creating static USB ports on Orange Pi Zero

#!/bin/bash

# Split the first command line argument by '/'
IFS='/' read -r -a items <<< "$1"

# Iterate through the items
for ((i=0; i<${#items[@]}; i++)); do
    # Check if the current item matches the pattern 'usb' followed by one or more digits
    if [[ ${items[$i]} =~ ^usb+$ ]]; then
      # Print the next item in the list and exit the loop
      echo "${items[$((i+1))]}"
      break
    fi
doneI was able to get static USB ports on an Orange Zero Pi with adding a udev rule refencing the script above like: ACTION=="add", KERNEL=="ttyUSB*", PROGRAM="/etc/udev/rules.d/usb-parse-devpath.sh %p", SYMLINK+="ttyUSB_%c"
page: [1]
View full version: creating static USB ports on Orange Pi Zero