diff options
Diffstat (limited to 'linhes/linhes-system/udev_link.sh')
-rwxr-xr-x | linhes/linhes-system/udev_link.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/linhes/linhes-system/udev_link.sh b/linhes/linhes-system/udev_link.sh new file mode 100755 index 0000000..7189f06 --- /dev/null +++ b/linhes/linhes-system/udev_link.sh @@ -0,0 +1,31 @@ +#!/bin/bash +my_base=$1 +dev_name=$2 +#DEVNAME=/dev/dvb/adapter2/frontend0 +#DVB_ADAPTER_NUM=2 + +lndir=`dirname $dev_name` +#for clink in `ls -d /dev/vstatic/dvb*` +for clink in `ls -d /dev/dvb/adapter_*` +do + if [ `readlink $clink` == $lndir ] + then + echo "link is already present $clink" + exit 0 + fi + +done +mkdir -p /dev/vstatic +for i in 1 2 3 4 +do + #mydir="/dev/vstatic/${my_base}_$i" + mydir="/dev/dvb/adapter_static_${my_base}_$i" + if [ ! -e $mydir ] + then + ln -s $lndir $mydir + exit 0 + else + echo "dvb dir already exists " + fi +done +exit 0 |