#!/bin/bash
#
source /etc/conf.d/vdr.admin.cfg
source /etc/conf.d/vdr

logger -s "ADMIN - GUI: $GUI"

if [ "$GUI" = "Aus" ] ; then
   rc-update del freevo
   rc-update del xdm
elif [ "$GUI" = "FreeVo" ]  ; then
   rc-update add freevo default
   sed -i /etc/conf.d/vdr.swcon -e "s/ -t .*/ -t FreeVo\"/"
   rc-update del xdm
   logger -s "Untersuche Audio und Videoverzeichnis - kann lange dauern !"
   freevo cache
elif [ "$GUI" = "KDE" ]  ; then
   sed -i /etc/conf.d/vdr.swcon -e "s/ -t .*/ -t KDE\"/"
   rc-update del freevo
   rc-update add xdm default
else
   echo "Unknown GUI parameter $1"
   exit 1
fi
exit 0
