diff --git a/bin/dm-add-experiment-file b/bin/dm-add-experiment-file new file mode 100755 index 0000000000000000000000000000000000000000..b4d86e88215c24cba500d820296c6d93fc91fb76 --- /dev/null +++ b/bin/dm-add-experiment-file @@ -0,0 +1,18 @@ +#!/bin/sh + +# Run command + +if [ -z $DM_ROOT_DIR ]; then + cd `dirname $0` && myDir=`pwd` + setupFile=$myDir/../setup.sh + if [ ! -f $setupFile ]; then + echo "Cannot find setup file: $setupFile" + exit 1 + fi + source $setupFile > /dev/null +fi +source dm_command_setup.sh + +eval "$DM_ROOT_DIR/src/python/dm/cat_web_service/cli/addExperimentFileCli.py $DM_COMMAND_ARGS" + + diff --git a/bin/dm-get-experiment-file b/bin/dm-get-experiment-file new file mode 100755 index 0000000000000000000000000000000000000000..32e17908c20d626f2a2edc47ba97a8b4dbae15d7 --- /dev/null +++ b/bin/dm-get-experiment-file @@ -0,0 +1,18 @@ +#!/bin/sh + +# Run command + +if [ -z $DM_ROOT_DIR ]; then + cd `dirname $0` && myDir=`pwd` + setupFile=$myDir/../setup.sh + if [ ! -f $setupFile ]; then + echo "Cannot find setup file: $setupFile" + exit 1 + fi + source $setupFile > /dev/null +fi +source dm_command_setup.sh + +eval "$DM_ROOT_DIR/src/python/dm/cat_web_service/cli/getExperimentFileCli.py $DM_COMMAND_ARGS" + + diff --git a/bin/dm-get-experiment-files b/bin/dm-get-experiment-files new file mode 100755 index 0000000000000000000000000000000000000000..0d8ada6d4652e8e21222e89b9841e06c8facb183 --- /dev/null +++ b/bin/dm-get-experiment-files @@ -0,0 +1,18 @@ +#!/bin/sh + +# Run command + +if [ -z $DM_ROOT_DIR ]; then + cd `dirname $0` && myDir=`pwd` + setupFile=$myDir/../setup.sh + if [ ! -f $setupFile ]; then + echo "Cannot find setup file: $setupFile" + exit 1 + fi + source $setupFile > /dev/null +fi +source dm_command_setup.sh + +eval "$DM_ROOT_DIR/src/python/dm/cat_web_service/cli/getExperimentFilesCli.py $DM_COMMAND_ARGS" + + diff --git a/bin/dm-get-files b/bin/dm-get-files new file mode 100755 index 0000000000000000000000000000000000000000..a429f8fb744fc63a3f467c90cc041974e04fa464 --- /dev/null +++ b/bin/dm-get-files @@ -0,0 +1,18 @@ +#!/bin/sh + +# Run command + +if [ -z $DM_ROOT_DIR ]; then + cd `dirname $0` && myDir=`pwd` + setupFile=$myDir/../setup.sh + if [ ! -f $setupFile ]; then + echo "Cannot find setup file: $setupFile" + exit 1 + fi + source $setupFile > /dev/null +fi +source dm_command_setup.sh + +eval "$DM_ROOT_DIR/src/python/dm/cat_web_service/cli/getFilesCli.py $DM_COMMAND_ARGS" + + diff --git a/bin/dm-start-daq b/bin/dm-start-daq index c7ff7e31208dfbc968c7742f33b5a73252108926..3192d84da4499824b8ecd2f30c13927b6ab9478e 100755 --- a/bin/dm-start-daq +++ b/bin/dm-start-daq @@ -11,7 +11,8 @@ if [ -z $DM_ROOT_DIR ]; then fi source $setupFile > /dev/null fi +source dm_command_setup.sh -$DM_ROOT_DIR/src/python/dm/daq_web_service/cli/startDaqCli.py $@ +eval "$DM_ROOT_DIR/src/python/dm/daq_web_service/cli/startDaqCli.py $DM_COMMAND_ARGS" diff --git a/bin/dm-update-experiment-file b/bin/dm-update-experiment-file new file mode 100755 index 0000000000000000000000000000000000000000..385a7a7dfe57e0d57e29106f0ff20425cd85f0b6 --- /dev/null +++ b/bin/dm-update-experiment-file @@ -0,0 +1,18 @@ +#!/bin/sh + +# Run command + +if [ -z $DM_ROOT_DIR ]; then + cd `dirname $0` && myDir=`pwd` + setupFile=$myDir/../setup.sh + if [ ! -f $setupFile ]; then + echo "Cannot find setup file: $setupFile" + exit 1 + fi + source $setupFile > /dev/null +fi +source dm_command_setup.sh + +eval "$DM_ROOT_DIR/src/python/dm/cat_web_service/cli/updateExperimentFileCli.py $DM_COMMAND_ARGS" + + diff --git a/bin/dm_command_setup.sh b/bin/dm_command_setup.sh new file mode 100755 index 0000000000000000000000000000000000000000..88a9c74d63595bc9355fc55be4d9c7a534c8dc0e --- /dev/null +++ b/bin/dm_command_setup.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +# Helper functions for DM commands. + +# Fix command line arguments +DM_COMMAND_ARGS="" +while [ $# -ne 0 ]; do + arg=$1 + if [[ $arg == -* ]]; then + key=`echo $arg | cut -f1 -d'='` + keyHasValue=`echo $arg | grep '='` + if [ ! -z "$keyHasValue" ]; then + value=`echo $arg | cut -f2- -d'='` + DM_COMMAND_ARGS="$DM_COMMAND_ARGS $key=\"$value\"" + else + DM_COMMAND_ARGS="$DM_COMMAND_ARGS $key" + fi + else + DM_COMMAND_ARGS="$DM_COMMAND_ARGS \"$arg\"" + fi + shift +done + +