diff --git a/salt/pcap/files/compile_bpf.sh b/salt/pcap/files/compile_bpf.sh deleted file mode 100644 index 44c5b8249..000000000 --- a/salt/pcap/files/compile_bpf.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# Copyright 2014 Google Inc. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if [ "$#" -lt 2 ]; then - cat 1>&2 <. {% set VERSION = salt['pillar.get']('static:soversion', 'HH1.1.4') %} {% set MASTER = salt['grains.get']('master') %} -{% set interface = salt['pillar.get']('sensor:interface', 'bond0') %} -{% set bpf_steno = salt['pillar.get']('steno:bpf', None) %} -{% set bpf_compiled = "" %} +{% set INTERFACE = salt['pillar.get']('sensor:interface', 'bond0') %} +{% set BPF_STENO = salt['pillar.get']('steno:bpf', None) %} +{% set BPF_COMPILED = "" %} # PCAP Section @@ -40,12 +40,12 @@ stenoconfdir: - group: 939 - makedirs: True -# BPF compilation and configuration -{% if bpf_steno %} - {% set bpf_calc = salt['cmd.script']('salt://pcap/files/compile_bpf.sh', interface + ' ' + bpf_steno) %} - {% if bpf_calc['stderr'] == "" %} - {% set bpf_compiled = ",\\\"--filter=" + bpf_calc['stdout'] + "\\\"" %} +{% if BPF_STENO %} + {% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', INTERFACE + ' ' + BPF_STENO|join(" ") ) %} + {% if BPF_CALC['stderr'] == "" %} + {% set BPF_COMPILED = ",\\\"--filter=" + BPF_CALC['stdout'] + "\\\"" %} {% else %} + bpfcompilationfailure: test.configurable_test_state: - changes: False @@ -63,7 +63,7 @@ stenoconf: - mode: 644 - template: jinja - defaults: - bpf_compiled: "{{ bpf_compiled }}" + BPF_COMPILED: "{{ BPF_COMPILED }}" sensoroniagentconf: file.managed: