mirror of
https://github.com/novatiq/packages.git
synced 2026-07-23 20:16:03 +01:00
20 lines
371 B
Bash
Executable File
20 lines
371 B
Bash
Executable File
#!/bin/sh
|
|
# Copyright (C) 2016 OpenWrt.org
|
|
|
|
[ "$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"
|
|
/etc/init.d/qemu-ga start
|
|
;;
|
|
"del")
|
|
rm -f "/dev/virtio-ports/$name"
|
|
;;
|
|
esac
|