mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-03 03:59:16 +01:00
Effectively use the specified directory as the CONFIG_PATH til .conf is read
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c5bb16ac26
commit
138638cb1a
@ -676,7 +676,11 @@ find_file()
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$g_shorewalldir" ]; then
|
||||
echo ${g_shorewalldir}/$1
|
||||
else
|
||||
echo ${g_confdir}/$1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
@ -6375,7 +6375,7 @@ sub isolate_source_interface( $ ) {
|
||||
} else {
|
||||
$source =~ tr/<>/[]/;
|
||||
|
||||
if ( $source =~ /^(.+?):(\[(?:.+)\],\[(?:.+)\])$/ ) {
|
||||
if ( $source =~ /^(.+?):(\[(?:.+),\[(?:.+)\])$/ ) {
|
||||
$iiface = $1;
|
||||
$inets = $2;
|
||||
} elsif ( $source =~ /^(.+?):\[(.+)\]\s*$/ ||
|
||||
@ -6386,7 +6386,7 @@ sub isolate_source_interface( $ ) {
|
||||
$iiface = $1;
|
||||
$inets = $2;
|
||||
} elsif ( $source =~ /:/ ) {
|
||||
if ( $source =~ /^\[(?:.+)\],\[(?:.+)\]$/ ){
|
||||
if ( $source =~ /^\[(?:.+),\[(?:.+)\]$/ ){
|
||||
$inets = $source;
|
||||
} elsif ( $source =~ /^\[(.+)\]$/ ) {
|
||||
$inets = $1;
|
||||
@ -6493,7 +6493,7 @@ sub isolate_dest_interface( $$$$ ) {
|
||||
} else {
|
||||
$dest =~ tr/<>/[]/;
|
||||
|
||||
if ( $dest =~ /^(.+?):(\[(?:.+)\],\[(?:.+)\])$/ ) {
|
||||
if ( $dest =~ /^(.+?):(\[(?:.+),\[(?:.+)\])$/ ) {
|
||||
$diface = $1;
|
||||
$dnets = $2;
|
||||
} elsif ( $dest =~ /^(.+?):\[(.+)\]\s*$/ ||
|
||||
@ -6504,7 +6504,7 @@ sub isolate_dest_interface( $$$$ ) {
|
||||
$diface = $1;
|
||||
$dnets = $2;
|
||||
} elsif ( $dest =~ /:/ ) {
|
||||
if ( $dest =~ /^\[(?:.+)\],\[(?:.+)\]$/ ){
|
||||
if ( $dest =~ /^\[(?:.+),\[(?:.+)\]$/ ){
|
||||
$dnets = $dest;
|
||||
} elsif ( $dest =~ /^\[(.+)\]$/ ) {
|
||||
$dnets = $1;
|
||||
|
@ -46,7 +46,11 @@ get_config() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
config=$(find_file $g_program.conf)
|
||||
else
|
||||
config="$g_shorewalldir/$g_program.conf"
|
||||
fi
|
||||
|
||||
if [ -f $config ]; then
|
||||
if [ -r $config ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user