Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function get_tty () {
- local vendor="${1}"
- local product="${2}"
- # return the tty{} value, eg; U2
- sysctl dev.umodem | grep "vendor=${vendor} product=${product}" | sed -r 's/.*ttyname=([^\s]+) .*/\1/'
- }
- function create_symlink () {
- local source="${1}"
- # failsafe
- if [ "${source}" == 'tty' ]; then return; fi
- #"Dane" below is the data pool name
- local target="/mnt/Dane/iocage/jails/${3}/root/dev/${2}"
- if [ -e "${target}" ]; then rm -f "${target}"; fi
- ln -s "${source}" "${target}"
- }
- # zigbee USB stick is a Conbee 2, "zigbee" below is the jail name with zigbee2mqtt installed.
- create_symlink "cua$(get_tty '0x1cf1' '0x0030')" "cuaUzigbee" "zigbee"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement