#!/bin/bash
#################################################
#
#      Filename: check_ovs_mirror_stat.sh
#
#        Author: mark.tang@ucloud.cn
#   Description: check ovs mirror stat
#        Create: 2021-12-24 15:15:07
# Last Modified: 2021-12-24 16:38:24
#################################################
ps -ef | grep -i openvswitch | grep -v grep 1>/dev/null 2>&1
is_ovs_runnig=`echo $?`

if [ "$is_ovs_runnig" -ne 0 ];then
    echo '[{"value":,"tags":""}]'
    exit 0
fi

check_mirror=`ovs-vsctl list mirror`
if [ -z "$check_mirror" ]
then
    echo '[{"value":0,"tags":""}]'
    exit 0
else
    echo '[{"value":1,"tags":""}]'
fi
