#!/bin/bash
# This copies whatever file is passed in to it to stdout to be picked up
# by xsiftx with an optional argument to use as the copied file name in 
# the dashboard

file="$4"
name="$5"

if [ ! -f "$file" ]; then
	echo "Path specified does not exist or is a directory." >&2
	exit -1
fi

if [ "$name" == "" ]; then
	echo $(basename "$file")
else
	echo $name
fi
cat $file
