From c95f3e81458c4e0978ef07cea521fec7130aba8f Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Sun, 26 Aug 2012 16:05:10 -0500
Subject: LinHES-config: install_functions.sh  renamed common->favorites for
 the default

---
 abs/core/LinHES-config/install_functions.sh | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)

diff --git a/abs/core/LinHES-config/install_functions.sh b/abs/core/LinHES-config/install_functions.sh
index 08206fc..69d978d 100755
--- a/abs/core/LinHES-config/install_functions.sh
+++ b/abs/core/LinHES-config/install_functions.sh
@@ -61,9 +61,10 @@ function bootsplash_setup (){
 
 function setupremote {
     [ -e $BASE/etc/lircd.conf ] && mv -f $BASE/etc/lircd.conf $BASE/etc/lircd.conf.`date +%Y-%m-%d-%H-%M`
-    if [ -d $TEMPLATES/remotes/$Remotetype ]
+    remotepath="$TEMPLATES/remotes/$remotebucket/$Remotetype"
+    if [ -d ${remotepath} ]
     then
-            cd $TEMPLATES/remotes/$Remotetype
+            cd ${remotepath}
             for i in lircd*
             do
                     cat $i >> $BASE/etc/lircd.conf
@@ -71,6 +72,8 @@ function setupremote {
             cp -f lircrc* $BASE/etc/lircrc 2> /dev/null
             [ -e /etc/lircrc ] && chmod 755 /etc/lircrc
             update_db_settings HostRemoteType  "$Remotetype"
+            update_db_settings HostRemotebucket "$remotebucket"
+            update_db_settings HostRemoteType_${remotebucket}  "$Remotetype"
         #special case for special remote
         printhl "Starting with support for $Remotetype"
         if [ "$Remotetype" == "dvico" ]
@@ -85,7 +88,7 @@ function setupremote {
         [ -e /root/.mythtv ] ||  mkdir /root/.mythtv 2>/dev/null
         ln -s /etc/lircrc /root/.mythtv/lircrc 2>/dev/null
     else
-        echo "Couldn't open directory $TEMPLATES/remotes/$Remotetype"
+        echo "Couldn't open directory ${remotepath}"
     fi
 }
 
@@ -100,6 +103,8 @@ do
         FoundReceiverType=`echo "$line"|cut -d"|" -f2`
         Remotetype=`echo "$line"|cut -d"|" -f4`
         statusline=`echo "$line"|cut -d"|" -f2,4`
+        remotebucket=`echo "$line"|cut -d"|" -f5`
+        #echo $remotebucket
         #echo "Found $statusline , $Remotetype"
         echo "Found Hauppauge"
         echo "-------------------"
@@ -139,6 +144,7 @@ do
     if [ $? -eq 0 ]
     then
         Remotetype=`echo "$line"|cut -d"|" -f2`
+        remotebucket=`echo "$line"|cut -d"|" -f4`
         printhl  "Found $Remotetype"
         setupremote
         found_remote=0
@@ -159,6 +165,8 @@ if [ $found_remote -eq 1  ]
 then
 #No remote found_remote
      update_db_settings HostRemoteType  "no_remote"
+     update_db_settings HostRemotebucket "favorites"
+     update_db_settings HostRemoteType_favorites  "no_remote"
 fi
 
 }
@@ -348,6 +356,8 @@ function init_remote {
     then
         TEMPVAR=${CMDLINE#*remoteport=}
         REMOTEPORT=${TEMPVAR%% *}
+        #port was given assume we are using a serial receiver
+        ReceiverType="Serial"
     if [ x"$ReceiverType" = "xSerial" ]
     then
         if [ -e /dev/$REMOTEPORT ]
@@ -362,11 +372,23 @@ function init_remote {
     fi
     in_kernel_support "disable"
 
+    echo $CMDLINE | grep -q remotebucket
+    if [ $? -eq 0 ]
+    then
+        TEMPVAR=${CMDLINE#*remotebucket=}
+        remotebucket=${TEMPVAR%% *}
+    else
+        remotebucket="favorites"
+    fi
+
+
+
     echo $CMDLINE | grep -q remote
     if [ $? -eq 0 ]
     then
         TEMPVAR=${CMDLINE#*remote=}
         Remotetype=${TEMPVAR%% *}
+
         setupremote
     else
         scan_for_usb_remote
-- 
cgit v0.12

