summarylogtreecommitdiffstats
path: root/gen-sddropin
blob: b3ee8c8de8b192ca7c01d4fedc4111ffd5c95473 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/bash
FILE=/etc/systemd/system/vdr.service.d/wait-for-devices.conf

if [ -d /dev/dvb/adapter0 ]; then
  mkdir -p $(dirname $FILE)
  echo "Replace or create the file $FILE"
  echo "with the following"
  echo
  echo '[Unit]'

  cd /dev
  for dev in dvb/adapter*/*; do
    stringpart=$(tr / - <<< $dev)
    echo "Wants=dev-$stringpart.device"
    echo "After=dev-$stringpart.device"
  done
else
  echo "No DVB devices detected. No systemd rule needed"
fi