forked from rfxn/advanced-policy-firewall
-
Notifications
You must be signed in to change notification settings - Fork 1
/
importconf
executable file
·30 lines (27 loc) · 910 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.6
# (C) 2002-2016, R-fx Networks <[email protected]>
# (C) 2016, Ryan MacDonald <[email protected]>
# This program may be freely redistributed under the terms of the GNU GPL v2
##
#
INSTALL_PATH=${INSTALL_PATH:-"/etc/apf"}
DEF=${DEF:-".ca.def"}
DOUT=${DOUT:-".conf.apf"}
if [ -d "$INSTALL_PATH.bk.last" ]; then
# get all the vars from current release
. $INSTALL_PATH/conf.apf
# replace with any vars old release had
. $INSTALL_PATH.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 $INSTALL_PATH.bk.last/*_hosts.rules /etc/apf/
cp -f $INSTALL_PATH.bk.last/vnet/*.rules /etc/apf/vnet/
OV=`cat $INSTALL_PATH.bk.last/VERSION | awk '{print$2}'`
NV=`cat $INSTALL_PATH/VERSION | awk '{print$2}'`
echo " Imported options from $OV to $NV."
fi