Retrieve LeafOutput operational

This commit is contained in:
2016-02-26 11:54:07 -05:00
parent 76722345a8
commit 59e2f9d8bd
14 changed files with 296 additions and 64 deletions
+58
View File
@@ -0,0 +1,58 @@
#!/bin/bash
# piscal launcher
usage="$(basename "$0") [-h] -d working_directory [-f input_filename] -- script to launch Piscal
where:
-h show this help text
-d working directory
-f input filename"
directory=""
input_filename=""
while getopts "hd:f:" opt; do
case "$opt" in
h )
echo "$usage"
exit
;;
d )
directory=$OPTARG
;;
f )
input_filename=$OPTARG
task="process"
;;
\?) printf "illegal option: -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
;;
esac
done
if [ -z "$directory" ]; then
echo "working directory required (-d)"
exit 1
fi
if [ ! -d "$directory" ]; then
echo "working directory $directory not found"
exit 1
fi
if [ -z "$input_filename" ]; then
echo "input filename required (-f)"
exit 1
fi
if [ ! -f "$directory/$input_filename" ]; then
echo "input filename $directory/$input_filename not found"
exit 1
fi
output_directory="$directory/output"
sleep 1m
if [ ! -d "$output_directory" ]; then
mkdir "$output_directory"
fi
# TODO: run actual command
cp "/home/poprhythm/LeafWebTestOutput"/* "$output_directory"