#!/bin/sh # # Setup TV modules options for modprobe test $# -lt 2 && echo "usage: $0 module_name has_radio" && exit 1 append_tv_option () { TV_OPTIONS="$TV_OPTIONS $1" } append_radio_option () { RADIO_OPTIONS="$RADIO_OPTIONS $1" } set_module_options () { OPT_FILE=/etc/modprobe.d/options # check if options file is not already set for this module grep -q "options $1" $OPT_FILE 2>/dev/null && return echo "options $1 $2" >> $OPT_FILE } . /etc/tvcard [ -f /etc/radio ] && . /etc/radio test "$TV_CARD" != "AUTO" && append_tv_option "card=$TV_CARD" test "$TV_TUNER" != "AUTO" && append_tv_option "tuner=$TV_TUNER" test "$RADIO" = yes && test "$2" = 1 && append_radio_option "radio=1" set_module_options $1 "$TV_OPTIONS $RADIO_OPTIONS" echo "" > /var/tvcard