mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 00:34:04 +01:00
Rename RESTOREPATH to g_restorepath
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c1ac19a81e
commit
061d850c16
@ -2260,16 +2260,16 @@ EOF
|
|||||||
kill $$
|
kill $$
|
||||||
exit 2
|
exit 2
|
||||||
else
|
else
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x $g_restorepath ]; then
|
||||||
echo Restoring ${PRODUCT:=Shorewall}...
|
echo Restoring ${PRODUCT:=Shorewall}...
|
||||||
|
|
||||||
RECOVERING=Yes
|
RECOVERING=Yes
|
||||||
export RECOVERING
|
export RECOVERING
|
||||||
|
|
||||||
if $RESTOREPATH restore; then
|
if $g_restorepath restore; then
|
||||||
echo "$PRODUCT restored from $RESTOREPATH"
|
echo "$PRODUCT restored from $g_restorepath"
|
||||||
set_state "Started"
|
set_state "Started"
|
||||||
else
|
else
|
||||||
set_state "Unknown"
|
set_state "Unknown"
|
||||||
|
@ -273,10 +273,10 @@ do_save() {
|
|||||||
|
|
||||||
if [ -f ${VARDIR}/firewall ]; then
|
if [ -f ${VARDIR}/firewall ]; then
|
||||||
if $iptables_save | iptablesbug > ${VARDIR}/restore-$$; then
|
if $iptables_save | iptablesbug > ${VARDIR}/restore-$$; then
|
||||||
cp -f ${VARDIR}/firewall $RESTOREPATH
|
cp -f ${VARDIR}/firewall $g_restorepath
|
||||||
mv -f ${VARDIR}/restore-$$ ${RESTOREPATH}-iptables
|
mv -f ${VARDIR}/restore-$$ ${g_restorepath}-iptables
|
||||||
chmod +x $RESTOREPATH
|
chmod +x $g_restorepath
|
||||||
echo " Currently-running Configuration Saved to $RESTOREPATH"
|
echo " Currently-running Configuration Saved to $g_restorepath"
|
||||||
run_user_exit save
|
run_user_exit save
|
||||||
else
|
else
|
||||||
rm -f ${VARDIR}/restore-$$
|
rm -f ${VARDIR}/restore-$$
|
||||||
@ -317,7 +317,7 @@ do_save() {
|
|||||||
#
|
#
|
||||||
# Don't save an 'empty' file
|
# Don't save an 'empty' file
|
||||||
#
|
#
|
||||||
grep -q '^-N' ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${RESTOREPATH}-ipsets
|
grep -q '^-N' ${VARDIR}/ipsets.tmp && mv -f ${VARDIR}/ipsets.tmp ${g_restorepath}-ipsets
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
@ -343,8 +343,8 @@ save_config() {
|
|||||||
if shorewall_is_started ; then
|
if shorewall_is_started ; then
|
||||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||||
|
|
||||||
if [ -f $RESTOREPATH -a ! -x $RESTOREPATH ]; then
|
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
|
||||||
echo " ERROR: $RESTOREPATH exists and is not a saved $PRODUCT configuration" >&2
|
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2
|
||||||
else
|
else
|
||||||
case $RESTOREFILE in
|
case $RESTOREFILE in
|
||||||
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
|
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
|
||||||
@ -915,20 +915,20 @@ restore_command() {
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
export NOROUTES
|
export NOROUTES
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x $g_restorepath ]; then
|
||||||
progress_message3 "Restoring Shorewall..."
|
progress_message3 "Restoring Shorewall..."
|
||||||
|
|
||||||
$SHOREWALL_SHELL $RESTOREPATH restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
|
$SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_off
|
[ -n "$nolock" ] || mutex_off
|
||||||
else
|
else
|
||||||
echo "File $RESTOREPATH: file not found"
|
echo "File $g_restorepath: file not found"
|
||||||
[ -n "$nolock" ] || mutex_off
|
[ -n "$nolock" ] || mutex_off
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
@ -292,6 +292,7 @@ None.
|
|||||||
IPT_OPTIONS
|
IPT_OPTIONS
|
||||||
PROFILE
|
PROFILE
|
||||||
PURGE
|
PURGE
|
||||||
|
RESTOREPATH
|
||||||
RING_BELL
|
RING_BELL
|
||||||
TEST
|
TEST
|
||||||
USE_VERBOSITY
|
USE_VERBOSITY
|
||||||
|
@ -506,13 +506,13 @@ start_command() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$g_fast" ]; then
|
if [ -n "$g_fast" ]; then
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x $g_restorepath ]; then
|
||||||
echo Restoring Shorewall...
|
echo Restoring Shorewall...
|
||||||
$SHOREWALL_SHELL $RESTOREPATH restore
|
$SHOREWALL_SHELL $g_restorepath restore
|
||||||
date > ${VARDIR}/restarted
|
date > ${VARDIR}/restarted
|
||||||
progress_message3 Shorewall restored from $RESTOREPATH
|
progress_message3 Shorewall restored from $g_restorepath
|
||||||
else
|
else
|
||||||
do_it
|
do_it
|
||||||
fi
|
fi
|
||||||
@ -964,7 +964,7 @@ safe_commands() {
|
|||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
export RESTOREFILE=.safe
|
export RESTOREFILE=.safe
|
||||||
RESTOREPATH=${VARDIR}/.safe
|
g_restorepath=${VARDIR}/.safe
|
||||||
save_config
|
save_config
|
||||||
progress_message3 "Restarting..."
|
progress_message3 "Restarting..."
|
||||||
;;
|
;;
|
||||||
@ -1101,7 +1101,7 @@ try_command() {
|
|||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
export RESTOREFILE=.try
|
export RESTOREFILE=.try
|
||||||
RESTOREPATH=${VARDIR}/.try
|
g_restorepath=${VARDIR}/.try
|
||||||
save_config
|
save_config
|
||||||
progress_message3 "Restarting..."
|
progress_message3 "Restarting..."
|
||||||
;;
|
;;
|
||||||
@ -1827,7 +1827,7 @@ case "$COMMAND" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
|
|
||||||
@ -1853,15 +1853,14 @@ case "$COMMAND" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
if [ -x $g_restorepath ]; then
|
||||||
|
rm -f $g_restorepath
|
||||||
if [ -x $RESTOREPATH ]; then
|
rm -f ${g_restorepath}-iptables
|
||||||
rm -f $RESTOREPATH
|
echo " $g_restorepath removed"
|
||||||
rm -f ${RESTOREPATH}-iptables
|
elif [ -f $g_restorepath ]; then
|
||||||
echo " $RESTOREPATH removed"
|
echo " $g_restorepath exists and is not a saved Shorewall configuration"
|
||||||
elif [ -f $RESTOREPATH ]; then
|
|
||||||
echo " $RESTOREPATH exists and is not a saved Shorewall configuration"
|
|
||||||
fi
|
fi
|
||||||
rm -f ${VARDIR}/save
|
rm -f ${VARDIR}/save
|
||||||
;;
|
;;
|
||||||
|
@ -254,10 +254,10 @@ do_save() {
|
|||||||
|
|
||||||
if [ -f ${VARDIR}/firewall ]; then
|
if [ -f ${VARDIR}/firewall ]; then
|
||||||
if $iptables_save > ${VARDIR}/restore-$$; then
|
if $iptables_save > ${VARDIR}/restore-$$; then
|
||||||
cp -f ${VARDIR}/firewall $RESTOREPATH
|
cp -f ${VARDIR}/firewall $g_restorepath
|
||||||
mv -f ${VARDIR}/restore-$$ ${RESTOREPATH}-iptables
|
mv -f ${VARDIR}/restore-$$ ${g_restorepath}-iptables
|
||||||
chmod +x $RESTOREPATH
|
chmod +x $g_restorepath
|
||||||
echo " Currently-running Configuration Saved to $RESTOREPATH"
|
echo " Currently-running Configuration Saved to $g_restorepath"
|
||||||
run_user_exit save
|
run_user_exit save
|
||||||
else
|
else
|
||||||
rm -f ${VARDIR}/restore-$$
|
rm -f ${VARDIR}/restore-$$
|
||||||
@ -284,8 +284,8 @@ save_config() {
|
|||||||
if shorewall6_is_started ; then
|
if shorewall6_is_started ; then
|
||||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||||
|
|
||||||
if [ -f $RESTOREPATH -a ! -x $RESTOREPATH ]; then
|
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
|
||||||
echo " ERROR: $RESTOREPATH exists and is not a saved $PRODUCT configuration" >&2
|
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2
|
||||||
else
|
else
|
||||||
case $RESTOREFILE in
|
case $RESTOREFILE in
|
||||||
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
|
capabilities|chains|default_route|firewall|firewall.conf|nat|proxyarp|restarted|rt_tables|save|state|undo_routing|zones)
|
||||||
@ -791,27 +791,27 @@ restore_command() {
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
export NOROUTES
|
export NOROUTES
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x $g_restorepath ]; then
|
||||||
if [ -x ${RESTOREPATH}-ipsets ] ; then
|
if [ -x ${g_restorepath}-ipsets ] ; then
|
||||||
echo Restoring Ipsets...
|
echo Restoring Ipsets...
|
||||||
$IP6TABLES -F
|
$IP6TABLES -F
|
||||||
$IP6TABLES -X
|
$IP6TABLES -X
|
||||||
$SHOREWALL_SHELL ${RESTOREPATH}-ipsets
|
$SHOREWALL_SHELL ${g_restorepath}-ipsets
|
||||||
fi
|
fi
|
||||||
|
|
||||||
progress_message3 "Restoring Shorewall6..."
|
progress_message3 "Restoring Shorewall6..."
|
||||||
|
|
||||||
$SHOREWALL_SHELL $RESTOREPATH restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
|
$SHOREWALL_SHELL $g_restorepath restore && progress_message3 "$PRODUCT restored from ${VARDIR}/$RESTOREFILE"
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_off
|
[ -n "$nolock" ] || mutex_off
|
||||||
else
|
else
|
||||||
echo "File $RESTOREPATH: file not found"
|
echo "File $g_restorepath: file not found"
|
||||||
[ -n "$nolock" ] || mutex_off
|
[ -n "$nolock" ] || mutex_off
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
@ -433,13 +433,13 @@ start_command() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$g_fast" ]; then
|
if [ -n "$g_fast" ]; then
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x $g_restorepath ]; then
|
||||||
echo Restoring Shorewall6...
|
echo Restoring Shorewall6...
|
||||||
$SHOREWALL_SHELL $RESTOREPATH restore
|
$SHOREWALL_SHELL $g_restorepath restore
|
||||||
date > ${VARDIR}/restarted
|
date > ${VARDIR}/restarted
|
||||||
progress_message3 Shorewall6 restored from $RESTOREPATH
|
progress_message3 Shorewall6 restored from $g_restorepath
|
||||||
else
|
else
|
||||||
do_it
|
do_it
|
||||||
fi
|
fi
|
||||||
@ -891,7 +891,7 @@ safe_commands() {
|
|||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
export RESTOREFILE=.safe
|
export RESTOREFILE=.safe
|
||||||
RESTOREPATH=${VARDIR}/.safe
|
g_restorepath=${VARDIR}/.safe
|
||||||
save_config
|
save_config
|
||||||
progress_message3 "Restarting..."
|
progress_message3 "Restarting..."
|
||||||
;;
|
;;
|
||||||
@ -1028,7 +1028,7 @@ try_command() {
|
|||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
export RESTOREFILE=.try
|
export RESTOREFILE=.try
|
||||||
RESTOREPATH=${VARDIR}/.try
|
g_restorepath=${VARDIR}/.try
|
||||||
save_config
|
save_config
|
||||||
progress_message3 "Restarting..."
|
progress_message3 "Restarting..."
|
||||||
;;
|
;;
|
||||||
@ -1714,7 +1714,7 @@ case "$COMMAND" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
[ -n "$nolock" ] || mutex_on
|
[ -n "$nolock" ] || mutex_on
|
||||||
|
|
||||||
@ -1740,21 +1740,20 @@ case "$COMMAND" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||||
|
|
||||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
if [ -x $g_restorepath ]; then
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x ${g_restorepath}-ipsets ]; then
|
||||||
|
rm -f ${g_restorepath}-ipsets
|
||||||
if [ -x ${RESTOREPATH}-ipsets ]; then
|
echo " ${g_restorepath}-ipsets removed"
|
||||||
rm -f ${RESTOREPATH}-ipsets
|
|
||||||
echo " ${RESTOREPATH}-ipsets removed"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f $RESTOREPATH
|
rm -f $g_restorepath
|
||||||
rm -f ${RESTOREPATH}-iptables
|
rm -f ${g_restorepath}-iptables
|
||||||
echo " $RESTOREPATH removed"
|
echo " $g_restorepath removed"
|
||||||
elif [ -f $RESTOREPATH ]; then
|
elif [ -f $g_restorepath ]; then
|
||||||
echo " $RESTOREPATH exists and is not a saved Shorewall6 configuration"
|
echo " $g_restorepath exists and is not a saved Shorewall6 configuration"
|
||||||
fi
|
fi
|
||||||
rm -f ${VARDIR}/save
|
rm -f ${VARDIR}/save
|
||||||
;;
|
;;
|
||||||
|
@ -649,7 +649,7 @@ SHELL cat /etc/shorewall/rules.d/*.rules</programlisting></para>
|
|||||||
|
|
||||||
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
||||||
|
|
||||||
<member><emphasis role="bold">RESTOREPATH</emphasis></member>
|
<member>RESTOREPATH</member>
|
||||||
|
|
||||||
<member>RING_BELL</member>
|
<member>RING_BELL</member>
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
||||||
|
|
||||||
<member><emphasis role="bold">RESTOREPATH</emphasis></member>
|
<member>RESTOREPATH</member>
|
||||||
|
|
||||||
<member>RING_BELL</member>
|
<member>RING_BELL</member>
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
||||||
|
|
||||||
<member><emphasis role="bold">RESTOREPATH</emphasis></member>
|
<member>RESTOREPATH</member>
|
||||||
|
|
||||||
<member>RING_BELL</member>
|
<member>RING_BELL</member>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user