+++ /dev/null
-#!/bin/bash
-###############################################################################
-# #
-# IPFire.org - A linux based firewall #
-# Copyright (C) 2010 Michael Tremer & Christian Schmidt #
-# #
-# This program is free software: you can redistribute it and/or modify #
-# it under the terms of the GNU General Public License as published by #
-# the Free Software Foundation, either version 3 of the License, or #
-# (at your option) any later version. #
-# #
-# This program is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
-# GNU General Public License for more details. #
-# #
-# You should have received a copy of the GNU General Public License #
-# along with this program. If not, see <http://www.gnu.org/licenses/>. #
-# #
-###############################################################################
-
-function event_emit() {
- local event=${1}
- shift
-
- log DEBUG "Emitting event '${event}' ($@)"
-
- # XXX Since we have no more upstart, we do nothing here for now.
- # At a later point of time, we need to find another solution how to
- # react on those events.
- #initctl emit ${event} $@
-
- case "${event}" in
- firewall-reload)
- # Try to reload the firewall service.
- __event_firewall_reload
- ;;
- esac
-}
-
-function __event_firewall_reload() {
- local service="firewall"
-
- # Reload the firewall service when it has
- # been started earlier.
- if service_is_running ${service}; then
- service_restart ${service}
- fi
-}
-
-function event_interface_up() {
- local iface=${1}
-
- event_emit network-interface-up IFACE=${iface}
-
- # XXX Just for now
- routing_default_update
-}
-
-function event_interface_down() {
- local iface=${1}
-
- event_emit network-interface-down IFACE=${iface}
-}
routing_db_from_ppp ${zone} ipv4
- # Request firewall reload
- event_emit firewall-reload
-
return ${EXIT_OK}
}
routing_update ${zone} ipv4
routing_default_update
- # Emit interface-up event
- event_interface_up ${zone}
-
return ${EXIT_OK}
}
# Save accounting information
ppp_accounting ${zone}
- # Emit interface-up event
- event_interface_down ${zone}
-
return ${EXIT_OK}
}
routing_update ${zone} ipv6
routing_default_update
- # Emit interface-up event
- event_interface_up ${zone}
-
return ${EXIT_OK}
}
# Save accounting information
ppp_accounting ${zone}
- # Emit interface-up event
- event_interface_down ${zone}
-
return ${EXIT_OK}
}