mirror of
https://github.com/openwrt/packages.git
synced 2025-02-14 13:48:04 +00:00
While at it, update copyright header. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
20 lines
401 B
Bash
Executable File
20 lines
401 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (C) 2016 OpenWrt.org
|
|
# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
|
|
|
|
[ "$SUBSYSTEM" = "virtio-ports" ] || exit 0
|
|
|
|
syspath="/sys/$DEVPATH"
|
|
name="$(cat "$syspath/name" 2>/dev/null)"
|
|
[ -n "$name" ] || exit 0
|
|
|
|
case "$ACTION" in
|
|
"add")
|
|
mkdir -p /dev/virtio-ports
|
|
ln -s "/dev/$DEVNAME" "/dev/virtio-ports/$name"
|
|
;;
|
|
"del")
|
|
rm -f "/dev/virtio-ports/$name"
|
|
;;
|
|
esac
|