29 lines
492 B
Bash
Executable file
29 lines
492 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if ! which gearman > /dev/null 2> /dev/null
|
|
then
|
|
echo "gearman isn't installed on this machine. Please try another one."
|
|
exit 1
|
|
fi
|
|
|
|
ACTION=
|
|
if [ -n "$1" ]
|
|
then
|
|
if [ "$1" = "flush" ]
|
|
then
|
|
ACTION=" <param name=\"action\">flush</param>
|
|
"
|
|
else
|
|
echo "Unknown action '$1'"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
cat <<EOF | gearman -h gearmand-srv -p 4730 -f moulette_get
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<process>
|
|
<param name="type">stats</param>
|
|
$ACTION</process>
|
|
EOF
|
|
|
|
echo
|