Update bastille config and prepare for RELEASE 12.2

This commit is contained in:
Jose
2021-01-04 16:08:12 -04:00
parent 408b864848
commit 5f611c1ec8
6 changed files with 3521 additions and 3 deletions
+21 -2
View File
@@ -9,7 +9,7 @@
# Debug script
#set -x
# Copyright (c) 2019-2020, José Rivera (joserprg@gmail.com).
# Copyright (c) 2019-2021, José Rivera (joserprg@gmail.com).
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
@@ -200,7 +200,7 @@ bastille_upgrade()
rm -R ${CWDIR}/update
fi
# Temporal workaround to update legacy config.
# Workaround to update legacy config.
if [ "${UPDATEVER}" -gt "0620200202" ]; then
update_config
fi
@@ -1032,6 +1032,8 @@ rc_params()
update_config()
{
# Update config based on minimum version.
# Network parameters.
if grep -qw 'bastille_jail_loopback=' ${BASTILLECONF}; then
sed -i '' 's/bastille_jail_loopback=/bastille_network_loopback=/' ${BASTILLECONF}
fi
@@ -1042,6 +1044,23 @@ update_config()
sed -i '' 's/bastille_jail_gateway=/bastille_network_gateway=/' ${BASTILLECONF}
fi
# Template parameters.
if grep -qw 'bastille_template_base=' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} bastille_template_base="default/base"
fi
if grep -qw 'bastille_template_empty=' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} bastille_template_empty="default/empty"
fi
if grep -qw 'bastille_template_thick=' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} bastille_template_thick="default/thick"
fi
if grep -qw 'bastille_template_thin=' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} bastille_template_thin="default/thin"
fi
if grep -qw 'bastille_template_vnet=' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} bastille_template_vnet="default/vnet"
fi
# Remove deprecated parameters based on minimum version.
if grep -qw 'bastille_jail_interface' ${BASTILLECONF}; then
sysrc -f ${BASTILLECONF} -x bastille_jail_interface