summaryrefslogtreecommitdiff
path: root/recipes/mythfront/mythfront-config/tftp.sh
blob: 8ac4bf802061e8439eaee0a03608f3855f6bd74b (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
34
35
36
#!/bin/sh

case $1 in
  renew|bound)
  	;;
  *)
  	exit 0
	;;
esac

bootdir=`dirname $boot_file`

files="mysql.txt lircrc mythfront.config"

mkdir /var/lib/config
cd /var/lib/config

for fn in $files; do
  if ! tftp -g $siaddr -r $bootdir/mythfront/$ip/$fn -l $fn; then
    if ! tftp -g $siaddr -r $bootdir/mythfront/default/$fn -l $fn; then
      rm -f $fn
    fi
  fi
done

if [ -f ./mythfront.config ]; then
  . ./mythfront.config
  if [ "x$REMOTE" != "x" ]; then
    fn=`find /usr/share/lirc/remotes -name lircd.conf.$REMOTE`
    if [ "x$fn" != "x" ]; then
      rm -f lircd.conf
      ln -sf $fn lircd.conf
    fi
  fi
fi