ha/service-mgmt/sm-1.0.0/scripts/sm.notify
Dean Troyer 17c909ec83 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:36:26 -07:00

41 lines
637 B
Bash

#! /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