#!/bin/sh case $1 in channellist) ls /etc/vdr/channels/* | sed 's/.*\/\(.*\)\.conf/\1/' ;; diseqclist) echo "-" grep "^# " /usr/share/diseqc_confs | cut -b 3- ;; scrlist) echo "-" grep "^# " /usr/share/scr_confs | cut -b 3- ;; remotelist) echo "-" cut /etc/vdr/remote.conf -d . -f 1 | sort -u ;; setlivebuffer) . /etc/init.d/rc.functions if [ "$VDR_LIVEBUFFER" = "to RAM" ]; then update_setting "VDR_ARGS" "-b /mnt/livebuffer $VDR_ARGS" echo "livebuffer /mnt/livebuffer tmpfs noatime,size=85% 0 0" >> /etc/fstab mkdir -p /mnt/livebuffer mount livebuffer else update_setting "VDR_ARGS" "$(echo "$VDR_ARGS" | sed 's|-b /mnt/livebuffer *||')" sed "/^livebuffer /d" -i /etc/fstab umount /mnt/livebuffer 2>/dev/null rmdir /mnt/livebuffer 2>/dev/null fi echo "PauseKeyHandling = $(test -n "$VDR_LIVEBUFFER" && echo 3 || echo 2)" >> /etc/vdr/setup.conf.add ;; setdiseqc) . /etc/rc.config grep "^# $VDR_DISEQC" /usr/share/diseqc_confs -A 100 | grep "^$" -B 100 -m 1 | sed '$d' >/etc/vdr/diseqc.conf echo "DiSEqC = $(test -z "$VDR_DISEQC"; echo $?)" >> /etc/vdr/setup.conf.add ;; setscr) . /etc/init.d/rc.functions grep "^# $VDR_SCR" /usr/share/scr_confs -A 100 | grep "^$" -B 100 -m 1 | sed '$d' >/etc/vdr/scr.conf if [ -n "$VDR_SCR" -a -z "$VDR_DISEQC" -o -n "${VDR_DISEQC##SCR*}" ]; then update_setting "VDR_DISEQC" "SCR 13V (Unicable)" $0 setdiseqc fi ;; resetremote) . /etc/rc.config sed "/^VDR_TRAIN_REMOTE/d" -i /etc/rc.config sed "/^$VDR_TRAIN_REMOTE\./d" -i /etc/vdr/remote.conf if [ "$VDR_TRAIN_REMOTE" = "XKeySym" ]; then grep "^KBD\." /etc/vdr/remote.conf > /tmp/remote.conf.kbd sed "/^KBD\./d" -i /etc/vdr/remote.conf fi ;; esac