#! /bin/bash
#
# Copyright (c) 2015 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#

# Read the options
TEMP=`getopt -o s:e: --long service:,event: -n 'test.sh' -- "$@"`
eval set -- "$TEMP"

# Extract options and their arguments into variables.
while true
do
  case "$1" in
    -s|--service)
      SERVICE=$2
      shift 2
      ;;

    -e|--event)
      EVENT=$2
      shift 2
      ;;

    --)
      shift
      break
      ;;

    *)
      echo "Unknown argument given, arg=$1"
      exit 1
      ;;
  esac
done

echo "1,1,SERVICE_EVENT,sm-notify,$SERVICE,$EVENT," | socat - unix-sendto:/tmp/.sm_notify_api

exit 0
