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