Config conversion script

master
bbruns 2010-10-13 21:30:38 +00:00
parent fc6b4ed4ce
commit 3061e16eb2
2 changed files with 35 additions and 13 deletions

View File

@ -27,19 +27,6 @@
# but if you want to make sure you have a current options file, define this to 0.
if [[ "$COMPAT_CONFIG" == "1" ]]; then
MODPROBE=`which modprobe`
# These are temp compatibility with old config files with IPv6
IPV6_FORWARD=${IPV6_FORWARD=$IPV6FORWARD}
IPV6_CONNTRACK=${IPV6_CONNTRACK=$IPV6CONNTRACK}
IPV6_BLOCKINCOMING=${$IPV6_BLOCKINCOMING=$IPV6BLOCKINCOMING}
IPV6_MARK=${IPV6_MARK=$IPv6_MARK}
IPV6_BLOCKED=${IPV6_BLOCKED=$BLOCKEDIPV6}
IPV6_CLAMPMSS=${IPV6_CLAMPMSS=$CLAMPMSSIPV6}
IPV6_INT=${IPV6_INT=$IPV6INT}
IPV6_LAN=${IPV6_LAN=$IPV6LAN}
IPV6_TRUSTED=${IPV6_TRUSTED=$IPV6TRUSTED}
IPV6_TCPPORTS=${IPV6_TCPPORTS=$IPV6TCP}
IPV6_UDPPORTS=${IPV6_UDPPORTS=$IPV6UDP}
IPV6_FORWARDRANGE=${IPV6_FORWARDRANGE=$IPV6FORWARDRANGE}
fi
PRERUN="$BASEDIR/prerun"

35
tools/convert-config Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
echo "This script converts certain aspects of old config files, such as renamed variables"
echo "to the new variable names. It is NOT foolproof, so please check your config files"
echo "afterwards."
IPV6_FORWARD=${IPV6_FORWARD=$IPV6FORWARD}
IPV6_CONNTRACK=${IPV6_CONNTRACK=$IPV6CONNTRACK}
IPV6_BLOCKINCOMING=${$IPV6_BLOCKINCOMING=$IPV6BLOCKINCOMING}
IPV6_MARK=${IPV6_MARK=$IPv6_MARK}
IPV6_BLOCKED=${IPV6_BLOCKED=$BLOCKEDIPV6}
IPV6_CLAMPMSS=${IPV6_CLAMPMSS=$CLAMPMSSIPV6}
IPV6_INT=${IPV6_INT=$IPV6INT}
IPV6_LAN=${IPV6_LAN=$IPV6LAN}
IPV6_TRUSTED=${IPV6_TRUSTED=$IPV6TRUSTED}
IPV6_TCPPORTS=${IPV6_TCPPORTS=$IPV6TCP}
IPV6_UDPPORTS=${IPV6_UDPPORTS=$IPV6UDP}
IPV6_FORWARDRANGE=${IPV6_FORWARDRANGE=$IPV6FORWARDRANGE}
sed -e 's/IPV6FORWARD/IPV6_FORWARD/' \
-e 's/IPV6CONNTRACK/IPV6_CONNTRACK/' \
-e 's/IPV6BLOCKINCOMING/IPV6_BLOCKINCOMING/' \
-e 's/IPv6_MARK/IPV6_MARK/' \
-e 's/BLOCKEDIPV6/IPV6_BLOCKED/' \
-e 's/CLAMPMSSIPV6/IPV6_CLAMPMSS/' \
-e 's/IPV6INT/IPV6_INT/' \
-e 's/IPV6LAN/IPV6_LAN/' \
-e 's/IPV6TRUSTED/IPV6_TRUSTED/' \
-e 's/IPV6TCP/IPV6_TCPPORTS/' \
-e 's/IPV6UDP/IPV6_UDPPORTS/' \
-e 's/IPV6FORWARDRANGE/IPV6_FORWARDRANGE/' \
-e 's/IPV6ROUTEDCLIENTBLOCK/IPV6_ROUTEDCLIENTBLOCK/' options >> options.new
mv options options.bak
mv options.new options