3 # This is a RackTables gateway for arbitrary file export. File contents doesn't
4 # matter here and will only be somehow sent to the remote host for further
7 # The only supported command is:
9 # * submit <username> <endpoint> <handler name> [filename1] [filename2] [...]
11 # Handler name can be any string used to distinguish different file processors.
12 # The temporary file will be passed to a script in current directory, if it exists.
13 # Script name is "<handlername>.install"
28 if [ -z "$user" -o -z "$endpoint" -o -z "$handler" ]; then
29 echo 'ERR!invalid arguments'
32 for cfgfile
in $files; do
33 if [ ! -f "$cfgfile" ]; then
34 echo "ERR!File $cfgfile is missing."
38 if [ ! -x "$MYDIR/$handler.install" ]; then
39 echo "ERR!Cannot execute $MYDIR/$handler.install"
42 "$MYDIR/$handler.install" "$user" "$endpoint" $files
47 echo "ERR!Main dispatcher: handler '$handler' returned code $ret"
52 while read cmd arg1 arg2 arg3 arg4
; do
55 do_submit
"$arg1" "$arg2" "$arg3" "$arg4"
58 echo "ERR!unknown command $cmd"