#!/bin/sh
#
# Description   : This script allows you to execute commands from a
#                 remote host.
#
# Synopsis      : rafdd_cmd_ssh <AFD workdir> <remote command>
#
# Author        : H.Kiehl
# Date          : 20.10.2003
#
# Modifications : 22.03.2004 H.Kiehl   Read afd-remote.env to allow
#                                      to set special environment.
#

if [ $# -lt 2 ]
then
   echo "Usage: $0 <AFD workdir> <remote command>"
   exit 1
fi

AFD_WORK_DIR=$1
PATH=@prefix@/bin:@prefix@/sbin:$PATH
export AFD_WORK_DIR PATH
if [ -f $AFD_WORK_DIR/etc/afd-remote.env ]
then
   . $AFD_WORK_DIR/etc/afd-remote.env
fi
shift

$*