diff options
Diffstat (limited to 'main/busybox-initscripts/dvbdev')
-rw-r--r-- | main/busybox-initscripts/dvbdev | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/main/busybox-initscripts/dvbdev b/main/busybox-initscripts/dvbdev new file mode 100644 index 00000000..f0186c17 --- /dev/null +++ b/main/busybox-initscripts/dvbdev @@ -0,0 +1,18 @@ +#!/bin/sh + +# MDEV=dvb0.demux1 -> ADAPTER=dvb0 -> N=0 +ADAPTER=${MDEV%.*} +N=${ADAPTER#dvb} +# MDEV=dvb0.demux1 -> DEVB_DEV=demux1 +DVB_DEV=${MDEV#*.} + +case "$ACTION" in + add|"") + mkdir -p dvb/adapter${N} + mv ${MDEV} dvb/adapter${N}/${DVB_DEV} + ;; + remove) + rm -f dvb/adapter${N}/${DVB_DEV} + rmdir dvb/adapter${N} 2>/dev/null + rmdir dvb/ 2>/dev/null +esac |