#!/bin/sh
#----------------------------------------------------------------------------
#  Name:     xdremote
#  Project:  Xdiary
#
#  Description:
#    Example of a script file to upload or download entries from and
#    to XDiary. It is up to you to modify this script so that it does
#    what YOU want it to do!
#
#    The default action is to print the parameters from XDiary.
#
#    Parameters:
#
#    The script receives the following parameters from XDiary over
#    stdin (which musr be read with read).
#
#      direction   - 'upload' or 'download'
#      calendar    - The name of the current calendar in the day view.
#      calendarDir - The directory for the current calendar in the day
#                    view.
#      host        - Communicate with this host machine.
#      uid         - Use this user ID on the remote host.
#      password    - Use this password on the remote host.
#      connType    - Type of connection we are using.
#
#  Filename:         xdremote.script
#
#  Authors:          Roger Larsson, Ulrika Bornetun
#  Creation date:    1991-04-28
#
#
#  (C) Copyright Ulrika Bornetun, Roger Larsson (1995)
#      All rights reserved
#
#  Permission to use, copy, modify, and distribute this software and its
#  documentation for any purpose and without fee is hereby granted,
#  provided that the above copyright notice appear in all copies. Ulrika
#  Bornetun and Roger Larsson make no representations about the usability
#  of this software for any purpose. It is provided "as is" without express
#  or implied warranty.
#----------------------------------------------------------------------------
#
# SCCSID = @(#) Module: xdremote.script, Version: 1.1, Date: 95/02/18 14:15:15

program=xdremote


# Read the parameters from XDiary.
read direction
read calendar
read calendarDir
read host
read uid
read password
read connectionType

# Upload entries.
if [ "$direction" = "upload" ]; then
  echo "Parameters passed: "
  echo " "
  echo "  Direction:      $direction"
  echo "  Calendar:       $calendar"
  echo "  Host:           $host"
  echo "  Uid:            $uid"
  echo "  Password:       <not echoed>"
  echo "  ConnectionType: $connectionType"
  echo " "
fi

# Download entries.
if [ "$direction" = "download" ]; then
  echo "Parameters passed: "
  echo " "
  echo "  Direction:      $direction"
  echo "  Calendar:       $calendar"
  echo "  Host:           $host"
  echo "  Uid:            $uid"
  echo "  Password:       <not echoed>"
  echo "  ConnectionType: $connectionType"
  echo " "
fi

exit 0
