#!/usr/bin/env bash set -eu synopsis() { cat << EOF Usage : `basename $0` [-h] EOF } help() { cat << EOF `basename $0` émet une commande au proxy (websockets). `synopsis` -h : affiche cette aide EOF } usage() { synopsis exit 1 } args() { local opt while getopts "h" opt; do case $opt in h) help; exit 0;; ?) usage;; esac done } # Programme principal VDN_PATH=$(readlink -f $(dirname $0)/..); . $VDN_PATH/bin/functions.sh args "$@" if [ -e $VDN_WS_PROXY_SOCKET ]; then echo $@ | socat - UNIX-CONNECT:$VDN_WS_PROXY_SOCKET fi