mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 17:58:07 +02:00
Replace SHOREWALL_DIR with g_shorewalldir
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
74cee48bc0
commit
0d4a6c1c28
@ -341,8 +341,8 @@ ensure_config_path() {
|
|||||||
. $F
|
. $F
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$SHOREWALL_DIR" ]; then
|
if [ -n "$g_shorewalldir" ]; then
|
||||||
[ "${CONFIG_PATH%%:*}" = "$SHOREWALL_DIR" ] || CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
|
[ "${CONFIG_PATH%%:*}" = "$g_shorewalldir" ] || CONFIG_PATH=$g_shorewalldir:$CONFIG_PATH
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2856,7 +2856,7 @@ shorewall_cli() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $2)
|
g_shorewalldir=$(resolve_file $2)
|
||||||
option=
|
option=
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
@ -363,18 +363,18 @@ compiler() {
|
|||||||
pc=$g_libexec/shorewall/compiler.pl
|
pc=$g_libexec/shorewall/compiler.pl
|
||||||
|
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
if [ -z "$SHOREWALL_DIR" -o "$SHOREWALL_DIR" = /etc/$g_program ]; then
|
if [ -z "$g_shorewalldir" -o "$g_shorewalldir" = /etc/$g_program ]; then
|
||||||
startup_error "Ordinary users may not compile the /etc/$g_program configuration"
|
startup_error "Ordinary users may not compile the /etc/$g_program configuration"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
# We've now set SHOREWALL_DIR so recalculate CONFIG_PATH
|
# We've now set g_shorewalldir so recalculate CONFIG_PATH
|
||||||
#
|
#
|
||||||
ensure_config_path
|
ensure_config_path
|
||||||
#
|
#
|
||||||
# Get the config from $SHOREWALL_DIR
|
# Get the config from $g_shorewalldir
|
||||||
#
|
#
|
||||||
[ -n "$SHOREWALL_DIR" -a "$SHOREWALL_DIR" != /etc/$g_program ] && get_config
|
[ -n "$g_shorewalldir" -a "$g_shorewalldir" != /etc/$g_program ] && get_config
|
||||||
|
|
||||||
case $COMMAND in
|
case $COMMAND in
|
||||||
*start|try|refresh)
|
*start|try|refresh)
|
||||||
@ -399,7 +399,7 @@ compiler() {
|
|||||||
[ -n "$STARTUP_LOG" ] && options="$options --log=$STARTUP_LOG"
|
[ -n "$STARTUP_LOG" ] && options="$options --log=$STARTUP_LOG"
|
||||||
[ -n "$LOG_VERBOSITY" ] && options="$options --log_verbosity=$LOG_VERBOSITY";
|
[ -n "$LOG_VERBOSITY" ] && options="$options --log_verbosity=$LOG_VERBOSITY";
|
||||||
[ -n "$g_export" ] && options="$options --export"
|
[ -n "$g_export" ] && options="$options --export"
|
||||||
[ -n "$SHOREWALL_DIR" ] && options="$options --directory=$SHOREWALL_DIR"
|
[ -n "$g_shorewalldir" ] && options="$options --directory=$g_shorewalldir"
|
||||||
[ -n "$g_timestamp" ] && options="$options --timestamp"
|
[ -n "$g_timestamp" ] && options="$options --timestamp"
|
||||||
[ -n "$g_test" ] && options="$options --test"
|
[ -n "$g_test" ] && options="$options --test"
|
||||||
[ -n "$g_preview" ] && options="$options --preview"
|
[ -n "$g_preview" ] && options="$options --preview"
|
||||||
@ -514,7 +514,7 @@ start_command() {
|
|||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
[ -n "$SHOREWALL_DIR" -o -n "$g_fast" ] && usage 2
|
[ -n "$g_shorewalldir" -o -n "$g_fast" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -524,7 +524,7 @@ start_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
AUTOMAKE=
|
AUTOMAKE=
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -633,7 +633,7 @@ compile_command() {
|
|||||||
[ -d $file ] && echo " ERROR: $file is a directory" >&2 && exit 2;
|
[ -d $file ] && echo " ERROR: $file is a directory" >&2 && exit 2;
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -643,7 +643,7 @@ compile_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
file=$2
|
file=$2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@ -716,7 +716,7 @@ check_command() {
|
|||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -726,7 +726,7 @@ check_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage 1
|
usage 1
|
||||||
@ -804,7 +804,7 @@ update_command() {
|
|||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -814,7 +814,7 @@ update_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage 1
|
usage 1
|
||||||
@ -886,7 +886,7 @@ restart_command() {
|
|||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -896,7 +896,7 @@ restart_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
[ -n "$g_fast" ] && fatal_error "Directory may not be specified with the -f option"
|
[ -n "$g_fast" ] && fatal_error "Directory may not be specified with the -f option"
|
||||||
AUTOMAKE=
|
AUTOMAKE=
|
||||||
;;
|
;;
|
||||||
@ -1044,7 +1044,7 @@ safe_commands() {
|
|||||||
0)
|
0)
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -1054,7 +1054,7 @@ safe_commands() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage 1
|
usage 1
|
||||||
@ -1139,7 +1139,7 @@ try_command() {
|
|||||||
timeout=
|
timeout=
|
||||||
|
|
||||||
handle_directory() {
|
handle_directory() {
|
||||||
[ -n "$SHOREWALL_DIR" ] && usage 2
|
[ -n "$g_shorewalldir" ] && usage 2
|
||||||
|
|
||||||
if [ ! -d $1 ]; then
|
if [ ! -d $1 ]; then
|
||||||
if [ -e $1 ]; then
|
if [ -e $1 ]; then
|
||||||
@ -1149,7 +1149,7 @@ try_command() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=$(resolve_file $1)
|
g_shorewalldir=$(resolve_file $1)
|
||||||
}
|
}
|
||||||
|
|
||||||
while [ $finished -eq 0 -a $# -gt 0 ]; do
|
while [ $finished -eq 0 -a $# -gt 0 ]; do
|
||||||
@ -1367,7 +1367,7 @@ reload_command() # $* = original arguments less the command.
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$getcaps" ]; then
|
if [ -z "$getcaps" ]; then
|
||||||
SHOREWALL_DIR=$(resolve_file $directory)
|
g_shorewalldir=$(resolve_file $directory)
|
||||||
ensure_config_path
|
ensure_config_path
|
||||||
capabilities=$(find_file capabilities)
|
capabilities=$(find_file capabilities)
|
||||||
[ -f $capabilities ] || getcaps=Yes
|
[ -f $capabilities ] || getcaps=Yes
|
||||||
|
@ -39,7 +39,6 @@ if [ $# -gt 0 ] && [ "$1" = "nolock" ]; then
|
|||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
SHOREWALL_DIR=
|
|
||||||
g_noroutes=
|
g_noroutes=
|
||||||
g_purge=
|
g_purge=
|
||||||
g_ipt_options="-nv"
|
g_ipt_options="-nv"
|
||||||
@ -57,9 +56,8 @@ g_recovering=
|
|||||||
g_timestamp=
|
g_timestamp=
|
||||||
g_libexec=/usr/share
|
g_libexec=/usr/share
|
||||||
g_perllib=/usr/share/shorewall
|
g_perllib=/usr/share/shorewall
|
||||||
#
|
g_shorewalldir=
|
||||||
# Make sure that these variables are cleared
|
|
||||||
#
|
|
||||||
VERBOSE=
|
VERBOSE=
|
||||||
VERBOSITY=
|
VERBOSITY=
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user