1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-vps.git synced 2025-03-09 15:50:00 +00:00

Doesn't download each firewall file for update

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-04-27 08:24:10 +00:00
parent 180a3fc0ac
commit c39b07eaa5

View file

@ -1157,22 +1157,14 @@ if [ "$update" = "0" ]; then
else
# Update only needed firewall files
if [ "$LOCALFILES" = "no" ]; then
wget -O /etc/shorewall/interfaces ${VPSURL}${VPSPATH}/shorewall4/interfaces
wget -O /etc/shorewall/snat ${VPSURL}${VPSPATH}/shorewall4/snat
wget -O /etc/shorewall/stoppedrules ${VPSURL}${VPSPATH}/shorewall4/stoppedrules
wget -O /etc/shorewall/tcinterfaces ${VPSURL}${VPSPATH}/shorewall4/tcinterfaces
wget -O /etc/shorewall/shorewall.conf ${VPSURL}${VPSPATH}/shorewall4/shorewall.conf
wget -O /etc/shorewall/policy ${VPSURL}${VPSPATH}/shorewall4/policy
wget -O /etc/shorewall/params ${VPSURL}${VPSPATH}/shorewall4/params
wget -O /etc/shorewall/params.vpn ${VPSURL}${VPSPATH}/shorewall4/params.vpn
wget -O /etc/shorewall/params.net ${VPSURL}${VPSPATH}/shorewall4/params.net
wget -O /etc/shorewall6/params ${VPSURL}${VPSPATH}/shorewall6/params
wget -O /etc/shorewall6/params.net ${VPSURL}${VPSPATH}/shorewall6/params.net
wget -O /etc/shorewall6/params.vpn ${VPSURL}${VPSPATH}/shorewall6/params.vpn
wget -O /etc/shorewall6/interfaces ${VPSURL}${VPSPATH}/shorewall6/interfaces
wget -O /etc/shorewall6/stoppedrules ${VPSURL}${VPSPATH}/shorewall6/stoppedrules
wget -O /etc/shorewall6/snat ${VPSURL}${VPSPATH}/shorewall6/snat
else
mkdir -p ${DIR}
wget -O ${DIR}/openmptcprouter-shorewall.tar.gz ${VPSURL}${VPSPATH}/openmptcprouter-shorewall.tar.gz
wget -O ${DIR}/openmptcprouter-shorewall6.tar.gz ${VPSURL}${VPSPATH}/openmptcprouter-shorewall6.tar.gz
mkdir -p ${DIR}/shorewall4
tar xzvf ${DIR}/openmptcprouter-shorewall.tar.gz -C ${DIR}/shorewall4
mkdir -p ${DIR}/shorewall6
tar xzvf ${DIR}/openmptcprouter-shorewall6.tar.gz -C ${DIR}/shorewall6
fi
cp ${DIR}/shorewall4/interfaces /etc/shorewall/interfaces
cp ${DIR}/shorewall4/snat /etc/shorewall/snat
cp ${DIR}/shorewall4/stoppedrules /etc/shorewall/stoppedrules
@ -1188,7 +1180,6 @@ else
cp ${DIR}/shorewall6/interfaces /etc/shorewall6/interfaces
cp ${DIR}/shorewall6/stoppedrules /etc/shorewall6/stoppedrules
cp ${DIR}/shorewall6/snat /etc/shorewall6/snat
fi
sed -i "s:eth0:$INTERFACE:g" /etc/shorewall/*
sed -i 's/^.*#DNAT/#DNAT/g' /etc/shorewall/rules
sed -i 's:10.0.0.2:$OMR_ADDR:g' /etc/shorewall/rules