-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmilk-exec
executable file
·66 lines (40 loc) · 1021 Bytes
/
milk-exec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
MSdescr="execute milk command"
MSextdescr="Execute command string within milk command line interface (CLI).
Multiple commands separated by : character"
source milk-script-std-config
RequiredCommands=(milk)
RequiredFiles=()
RequiredDirs=()
MSarg+=( "commandstring:string:command string" )
MSopt+=( "n:name:set_pname:pname[string]:(n)ame process" )
function set_pname() {
pname="$1"
}
MSopt+=( "T:testmode:set_testmode::(T)est mode" )
function set_testmode() {
echo "CTEST_FULL_OUTPUT"
}
source milk-argparse
cmdstring="${inputMSargARRAY[0]}"
echo "command string : ${cmdstring}"
IFS=';' read -r -a array <<< "${cmdstring}"
#fifoname="milkCLIfifo.${pname}"
set +u
if [ -w "${MILK_SHM_DIR}/" ];
then
SFDIR="${MILK_SHM_DIR}/"
else
SFDIR="/tmp"
fi
set -u
SF="${SFDIR}/milkCLIstartup.${pname}.$$"
echo "" > $SF
for cmdstring in "${array[@]}"
do
echo "${cmdstring}" >> $SF
done
echo "exitCLI" >> $SF
#cp ${SF} test.txt
MILK_QUIET=1 milk -n ${pname} -f -s ${SF}
rm ${SF}