Blame SOURCES/ebtables.systemd

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