Blame SOURCES/ebtables.systemd

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