#! /bin/sh # GUI executes /usr/local/m2/m2_pcap # This will be wrapper which will execute: # m2_pcap_tshark.sh if pcap_tshark_active = 1 in system.conf # Original m2_pcap (renamed as m2_pcapsipdump) if pcap_tshark_active is not 1 or does not exist # Also wrapper is needed to execute script as bash, otherwise it will run as sh if executed directly from ruby config="/etc/m2/system.conf" m2_pcap_tshark=$(sed 's/ //g' $config | awk -F"=" '/pcap_tshark_active/{print $2}') if [ -n "$m2_pcap_tshark" ] && [ "$m2_pcap_tshark" = 1 ]; then if [ -e /usr/local/m2/m2_pcap_tshark.sh ]; then /bin/bash /usr/local/m2/m2_pcap_tshark.sh "$1" "$2" "$3" "$4" "$5" "$6" fi else if [ -e /usr/local/m2/m2_pcapsipdump ]; then /usr/local/m2/m2_pcapsipdump "$1" "$2" "$3" "$4" "$5" "$6" fi fi