Blame SOURCES/ebtables.systemd

029dc7
#!/bin/bash
029dc7
029dc7
RETVAL=0
029dc7
EBTCONF=/etc/sysconfig/ebtables
029dc7
029dc7
initialize() {
029dc7
  # Initialize $TYPE tables
029dc7
  echo -n $"  $TYPE tables: "
029dc7
  if [ -r /etc/sysconfig/ebtables.$TYPE ]; then
029dc7
    /sbin/ebtables -t $TYPE --atomic-file /etc/sysconfig/ebtables.$TYPE --atomic-commit > /dev/null || RETVAL=1
029dc7
  else
029dc7
    echo -n "not configured"
029dc7
  fi
029dc7
  if [ $RETVAL -eq 0 ]; then
029dc7
    echo -n $"[  OK  ]"
029dc7
    echo -ne "\r"
029dc7
  else
029dc7
    echo -n $"[FAILED]"
029dc7
    echo -ne "\r"
029dc7
  fi
029dc7
}
029dc7
029dc7
case $1 in
029dc7
  start)
029dc7
    if [[ -r $EBTCONF ]]; then
029dc7
      ebtables-restore <$EBTCONF
029dc7
      RETVAL=$?
029dc7
    else
029dc7
      echo -n "not configured"
029dc7
    fi
029dc7
    if [ $RETVAL -eq 0 ]; then
029dc7
      echo -n $"[  OK  ]"
029dc7
      echo -ne "\r"
029dc7
    else
029dc7
      echo -n $"[FAILED]"
029dc7
      echo -ne "\r"
029dc7
    fi
029dc7
  ;;
029dc7
  stop)
029dc7
    [[ $EBTABLES_SAVE_ON_STOP == "yes" ]] && $0 save
029dc7
    /sbin/ebtables --init-table
029dc7
    RETVAL=$?
029dc7
029dc7
    if [ $RETVAL -eq 0 ]; then
029dc7
      echo -n $"[  OK  ]"
029dc7
      echo -ne "\r"
029dc7
    else
029dc7
      echo -n $"[FAILED]"
029dc7
      echo -ne "\r"
029dc7
    fi
029dc7
  ;;
029dc7
  save)
029dc7
    echo -n $"Saving Ethernet bridge filtering (ebtables): "
029dc7
    ebtables-save >$EBTCONF
029dc7
    RETVAL=$?
029dc7
029dc7
    if [ $RETVAL -eq 0 ]; then
029dc7
      echo -n $"[  OK  ]"
029dc7
      echo -ne "\r"
029dc7
    else
029dc7
      echo -n $"[FAILED]"
029dc7
      echo -ne "\r"
029dc7
    fi
029dc7
  ;;
029dc7
  *)
029dc7
    echo "usage: ${0##*/} {start|stop|save}" >&2
029dc7
    exit 1
029dc7
  ;;
029dc7
esac
029dc7
029dc7
# vim:set ts=2 sw=2 ft=sh et: