#!/bin/sh
#
AKTDIR=`pwd`

/etc/init.d/lirc stop

#Kernel module
/sbin/yast2 --install lirc-kmp-default

cat > /etc/lircd.conf << EOF
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.0(userspace) on Thu May 17 16:32:01 2007
#
# contributed by 
#
# brand:                       xxx
# model no. of remote control: 
# devices being controlled by this remote:
#

begin remote

  name  Technisat_USB_HID_Dongle
  bits            8
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  pre_data_bits   24
  pre_data       0x800100
  gap           10000
  toggle_bit      0


      begin codes
          MUTE                     0x32
          1                        0x02
          2                        0x03
          3                        0x04
          4                        0x05
          5                        0x06
          6                        0x07
          7                        0x08
          8                        0x09
          9                        0x0A
          -/--                     0x13
          0                        0x0B
          A/B                      0x1F
          RED                      0x3F
          GREEN                    0x40
          YELLOW                   0x41
          BLUE                     0x42
          UP                       0x67
          DOWN                     0x6C
          LEFT                     0x69
          RIGHT                    0x6A
          OK                       0x1C
          EPG                      0x12
          EXIT                     0x21
          INFO                     0x17
          TV/RADIO                 0x43
          MENU                     0x3C
          HILFE                    0x17
          TXT                      0x14
          STOP                     0x19
          EXT                      0x2F
      end codes

end remote
EOF

sed -e "s/LIRCD_DEV_PERMISSIONS=\"660\"/LIRCD_DEV_PERMISSIONS=\"666\"/g" -e "s/LIRCD_DRIVER=\"\"/LIRCD_DRIVER=\"dev\/input\"/g" -e "s/LIRCD_DEVICE=\"\"/LIRCD_DEVICE=\"\/dev\/input\/ir\"/g" /etc/sysconfig/lirc > /etc/sysconfig/lirc.new
chmod 644 /etc/sysconfig/lirc.new
mv -f /etc/sysconfig/lirc.new /etc/sysconfig/lirc

insserv -d /etc/init.d/lirc
/etc/init.d/lirc restart

#/usr/local/sbin/lircd -p 666 -H dev/input -d /dev/input/ir /usr/local/etc/lircd.conf.technisat-usb-dongle

