forked from rfxn/advanced-policy-firewall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
importconf
executable file
·30 lines (27 loc) · 841 Bytes
/
importconf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
##
# Advanced Policy Firewall (APF) v1.7.5
# (C) 2002-2014, R-fx Networks <[email protected]>
# (C) 2014, Ryan MacDonald <[email protected]>
# This program may be freely redistributed under the terms of the GNU GPL v2
##
#
INSTALL_PATH="/etc/apf"
DEF=".ca.def"
DOUT=".conf.apf"
if [ -d "/etc/apf.bk.last" ]; then
# get all the vars from current release
. /etc/apf/conf.apf
# replace with any vars old release had
. /etc/apf.bk.last/conf.apf
# generate new conf
. $DEF
cp -f $INSTALL_PATH/conf.apf $INSTALL_PATH/conf.apf.orig
cp -f $DOUT $INSTALL_PATH/conf.apf
cp -f /etc/apf.bk.last/*_hosts.rules /etc/apf/
cp -f /etc/apf.bk.last/vnet/*.rules /etc/apf/vnet/
OV=`cat /etc/apf.bk.last/VERSION | awk '{print$2}'`
NV=`cat /etc/apf/VERSION | awk '{print$2}'`
echo " Imported options from $OV to $NV."
fi