#!/bin/sh

# Localisation
export TEXTDOMAINDIR="/usr/share/locale"
export TEXTDOMAIN=kanotix-vdr

DOWNLOAD="http://mitglied.lycos.de/peterweber69/vdr-xine"
#DIALOG=Xdialog
DIALOG=dialog

INSTALLED=""
[ -d /KNOPPIX -o -d /KANOTIX ] || INSTALLED="yes"

if [ -z "$INSTALLED" ]; then
   if grep -q unionfs /proc/mounts; then
      echo Unionfs found.
   else
      echo Activating Unionfs now.
      mkdir -p /tmp/union
      UNION=/KNOPPIX
      [ -d /KANOTIX ] && UNION=/KANOTIX
      mount -t unionfs -o dirs=/tmp/union/:$UNION /none $UNION/ 2>&1 >/dev/null
   fi
fi

$DIALOG --title $"VDR-xine Keyboardlayout" --yesno \
$"When running this script, you need an active internet connection!\n\nProceed" 0 0
answer="$?"
[ "$answer" = 1 ] && exit 1
tput clear

echo $"Getting xine settings for VDR  (~/.xine/config, ~/.xine/keymap) ..."

cd $HOME
wget $DOWNLOAD/xine.conf.tgz

BACKUPFILE=".xine.backup-kanotix-vdr.sh.$NOW"
cp -R .xine "$BACKUPFILE"
rm -f .xine/config .xine/keymap
tar xvfz xine.conf.tgz
rm -f xine.conf.tgz

echo
echo
echo " >>> "$"Your xine configuration was backed up in $BACKUPFILE gesichert!"" <<<"

echo 
echo $"Press any key" && read


