17 lines
275 B
Text
17 lines
275 B
Text
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
# Usage: ./execute_command_client.sh <command>
|
||
|
|
|
||
|
|
if [ $# -ne 1 ]; then
|
||
|
|
echo "Usage: $0 <command>"
|
||
|
|
exit 1
|
||
|
|
fi
|
||
|
|
|
||
|
|
command="$1"
|
||
|
|
|
||
|
|
# Connect to socket and send command
|
||
|
|
output=$(nc -U {{ statedir }}/{{ name }}.monitoring <<< "$command")
|
||
|
|
|
||
|
|
# Print output
|
||
|
|
echo "$output"
|