#!/bin/bash 

VALUE="" 
while true; do 

  tmpfile=$(mktemp -t)
  zenity --list --width 300 --height 100 --text "Synchronisation Notebook-PC:" \
	--column "" --column "Quelle/Ziel" \
	1 "Notebook to PC" \
  	2 "PC to Notebook" > $tmpfile
  read VALUE < $tmpfile

 if [ "$VALUE" = "1" ]; then 
	sudo mount -t cifs "//192.88.81.123/freigabe" "/mnt/notebook/" -o umask=000,iocharset=utf8,codepage=850,sec=none
	[ $? == "0" ] && rsync --ignore-times -t -r --progress --delete "/mnt/notebook/" "/home/test/xyz/"
	sudo umount "/mnt/notebook/"
  elif [ "$VALUE" = "2" ]; then 
	sudo mount -t cifs "//192.88.81.123/freigabe" "/mnt/notebook/" -o umask=000,iocharset=utf8,codepage=850,sec=none
	[ $? == "0" ] && rsync --ignore-times -t -r --progress --delete "/home/test/xyz/" "/mnt/notebook/"
	sudo umount "/mnt/notebook/"
  else 
	break
  fi

done


