#!/bin/sh
#
# Copyright (c) 2001-2003 Gregory M. Kurtzer
#
# Copyright (c) 2003-2011, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy).  All rights reserved.
#


. /etc/functions


if [ -z "$TRANSPORT" ]; then
    WWTRANSPORT="http"
fi

PROG=`basename $0`

if [ -f "/warewulf/transports/$WWTRANSPORT/register" ]; then
    if [ -x "/warewulf/transports/$WWTRANSPORT/$PROG" ]; then
        exec /warewulf/transports/$WWTRANSPORT/$PROG "$@"
    elif [ -f "/warewulf/transports/$WWTRANSPORT/$PROG" ]; then
        echo "WARNING: /warewulf/transports/$WWTRANSPORT/$PROG is not executable"
    fi
else
    echo "WARNING: Transport method $WWTRANSPORT is not supported!" 1>&2
fi
