packages: libs/savedynamic: rename package to firewall-mod-save and script to 20_save.sh (from savedynamic.sh). Thanks jow
git-svn-id: svn://svn.openwrt.org/openwrt/packages@21371 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
b3e02856ab
commit
810e7c4bf1
@ -8,28 +8,27 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=savedynamic
|
||||
PKG_NAME:=firewall-mod-save
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
MAINTAINER:=Daniel Dickinson <cshore@csolve.net>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/savedynamic/Default
|
||||
define Package/firewall-mod-save/Default
|
||||
SECTION:=libs
|
||||
CATEGORY:=Libraries
|
||||
TITLE:=Preserve dynamic chains during firewall restart
|
||||
endef
|
||||
|
||||
define Package/savedynamic
|
||||
$(call Package/savedynamic/Default)
|
||||
MENU:=1
|
||||
define Package/firewall-mod-save
|
||||
$(call Package/firewall-mod-save/Default)
|
||||
DEPENDS:=+iptables-utils
|
||||
endef
|
||||
|
||||
define Package/savedynamic/description
|
||||
define Package/firewall-mod-save/description
|
||||
Uses iptables-save to save the option chain in option table (default filter)
|
||||
as defined by the config section save in /etc/config/firewall.
|
||||
endef
|
||||
@ -43,10 +42,10 @@ endef
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/block-extroot/install
|
||||
define Package/firewall-mod-save/install
|
||||
$(INSTALL_DIR) $(1)/lib/firewall
|
||||
$(INSTALL_DATA) ./files/savedynamic.sh $(1)/lib/firewall/
|
||||
$(INSTALL_DATA) ./files/20_save.sh $(1)/lib/firewall/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,savedynamic))
|
||||
$(eval $(call BuildPackage,firewall-mod-save))
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
. /etc/functions.sh
|
||||
|
||||
savedynamic_print_table_chain() {
|
||||
save_print_table_chain() {
|
||||
local table="$1"
|
||||
local chain="$2"
|
||||
local fsave="$3"
|
||||
@ -28,7 +28,7 @@ savedynamic_print_table_chain() {
|
||||
rm -f "$fsavetmp"
|
||||
}
|
||||
|
||||
savedynamic_save_fw_chain() {
|
||||
save_save_fw_chain() {
|
||||
local chain
|
||||
local table
|
||||
local fsave="/tmp/.firewall/save"
|
||||
@ -38,11 +38,11 @@ savedynamic_save_fw_chain() {
|
||||
[ -z "$chain" ] && return 0
|
||||
mkdir -p /tmp/.firewall
|
||||
iptables-save >"$fsave"
|
||||
savedynamic_print_table_chain $table $chain "$fsave" > /tmp/.firewall/save-$table-$chain
|
||||
save_print_table_chain $table $chain "$fsave" > /tmp/.firewall/save-$table-$chain
|
||||
|
||||
}
|
||||
|
||||
savedynamic_load_fw_chain() {
|
||||
save_load_fw_chain() {
|
||||
local chain
|
||||
local table
|
||||
|
||||
@ -57,16 +57,17 @@ savedynamic_load_fw_chain() {
|
||||
}
|
||||
}
|
||||
|
||||
savedynamic_pre_stop_cb() {
|
||||
save_pre_stop_cb() {
|
||||
echo "Saving dynamic firewall chains"
|
||||
config_load firewall
|
||||
|
||||
config_foreach savedynamic_save_fw_chain save
|
||||
config_foreach save_save_fw_chain save
|
||||
}
|
||||
|
||||
savedynamic_post_core_cb() {
|
||||
save_post_core_cb() {
|
||||
echo "Loading dynamic firewall chains"
|
||||
|
||||
config_load firewall
|
||||
config_foreach savedynamic_load_fw_chain save
|
||||
config_foreach save_load_fw_chain save
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user