summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-config/udev_link.sh
blob: ec8bdcf57886c857e13771adf4126155c944edbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/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