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 $$
|
||||
exit 2
|
||||
else
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
if [ -x $g_restorepath ]; then
|
||||
echo Restoring ${PRODUCT:=Shorewall}...
|
||||
|
||||
RECOVERING=Yes
|
||||
export RECOVERING
|
||||
|
||||
if $RESTOREPATH restore; then
|
||||
echo "$PRODUCT restored from $RESTOREPATH"
|
||||
if $g_restorepath restore; then
|
||||
echo "$PRODUCT restored from $g_restorepath"
|
||||
set_state "Started"
|
||||
else
|
||||
set_state "Unknown"
|
||||
|
@ -273,10 +273,10 @@ do_save() {
|
||||
|
||||
if [ -f ${VARDIR}/firewall ]; then
|
||||
if $iptables_save | iptablesbug > ${VARDIR}/restore-$$; then
|
||||
cp -f ${VARDIR}/firewall $RESTOREPATH
|
||||
mv -f ${VARDIR}/restore-$$ ${RESTOREPATH}-iptables
|
||||
chmod +x $RESTOREPATH
|
||||
echo " Currently-running Configuration Saved to $RESTOREPATH"
|
||||
cp -f ${VARDIR}/firewall $g_restorepath
|
||||
mv -f ${VARDIR}/restore-$$ ${g_restorepath}-iptables
|
||||
chmod +x $g_restorepath
|
||||
echo " Currently-running Configuration Saved to $g_restorepath"
|
||||
run_user_exit save
|
||||
else
|
||||
rm -f ${VARDIR}/restore-$$
|
||||
@ -317,7 +317,7 @@ do_save() {
|
||||
#
|
||||
# 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
|
||||
;;
|
||||
@ -343,8 +343,8 @@ save_config() {
|
||||
if shorewall_is_started ; then
|
||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||
|
||||
if [ -f $RESTOREPATH -a ! -x $RESTOREPATH ]; then
|
||||
echo " ERROR: $RESTOREPATH exists and is not a saved $PRODUCT configuration" >&2
|
||||
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
|
||||
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2
|
||||
else
|
||||
case $RESTOREFILE in
|
||||
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
|
||||
fi
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
export NOROUTES
|
||||
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
if [ -x $g_restorepath ]; then
|
||||
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
|
||||
else
|
||||
echo "File $RESTOREPATH: file not found"
|
||||
echo "File $g_restorepath: file not found"
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
exit 2
|
||||
fi
|
||||
|
@ -292,6 +292,7 @@ None.
|
||||
IPT_OPTIONS
|
||||
PROFILE
|
||||
PURGE
|
||||
RESTOREPATH
|
||||
RING_BELL
|
||||
TEST
|
||||
USE_VERBOSITY
|
||||
|
@ -506,13 +506,13 @@ start_command() {
|
||||
fi
|
||||
|
||||
if [ -n "$g_fast" ]; then
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
if [ -x $g_restorepath ]; then
|
||||
echo Restoring Shorewall...
|
||||
$SHOREWALL_SHELL $RESTOREPATH restore
|
||||
$SHOREWALL_SHELL $g_restorepath restore
|
||||
date > ${VARDIR}/restarted
|
||||
progress_message3 Shorewall restored from $RESTOREPATH
|
||||
progress_message3 Shorewall restored from $g_restorepath
|
||||
else
|
||||
do_it
|
||||
fi
|
||||
@ -964,7 +964,7 @@ safe_commands() {
|
||||
;;
|
||||
restart)
|
||||
export RESTOREFILE=.safe
|
||||
RESTOREPATH=${VARDIR}/.safe
|
||||
g_restorepath=${VARDIR}/.safe
|
||||
save_config
|
||||
progress_message3 "Restarting..."
|
||||
;;
|
||||
@ -1101,7 +1101,7 @@ try_command() {
|
||||
;;
|
||||
restart)
|
||||
export RESTOREFILE=.try
|
||||
RESTOREPATH=${VARDIR}/.try
|
||||
g_restorepath=${VARDIR}/.try
|
||||
save_config
|
||||
progress_message3 "Restarting..."
|
||||
;;
|
||||
@ -1827,7 +1827,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
esac
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
|
||||
@ -1853,15 +1853,14 @@ case "$COMMAND" in
|
||||
;;
|
||||
esac
|
||||
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
rm -f $RESTOREPATH
|
||||
rm -f ${RESTOREPATH}-iptables
|
||||
echo " $RESTOREPATH removed"
|
||||
elif [ -f $RESTOREPATH ]; then
|
||||
echo " $RESTOREPATH exists and is not a saved Shorewall configuration"
|
||||
if [ -x $g_restorepath ]; then
|
||||
rm -f $g_restorepath
|
||||
rm -f ${g_restorepath}-iptables
|
||||
echo " $g_restorepath removed"
|
||||
elif [ -f $g_restorepath ]; then
|
||||
echo " $g_restorepath exists and is not a saved Shorewall configuration"
|
||||
fi
|
||||
rm -f ${VARDIR}/save
|
||||
;;
|
||||
|
@ -254,10 +254,10 @@ do_save() {
|
||||
|
||||
if [ -f ${VARDIR}/firewall ]; then
|
||||
if $iptables_save > ${VARDIR}/restore-$$; then
|
||||
cp -f ${VARDIR}/firewall $RESTOREPATH
|
||||
mv -f ${VARDIR}/restore-$$ ${RESTOREPATH}-iptables
|
||||
chmod +x $RESTOREPATH
|
||||
echo " Currently-running Configuration Saved to $RESTOREPATH"
|
||||
cp -f ${VARDIR}/firewall $g_restorepath
|
||||
mv -f ${VARDIR}/restore-$$ ${g_restorepath}-iptables
|
||||
chmod +x $g_restorepath
|
||||
echo " Currently-running Configuration Saved to $g_restorepath"
|
||||
run_user_exit save
|
||||
else
|
||||
rm -f ${VARDIR}/restore-$$
|
||||
@ -284,8 +284,8 @@ save_config() {
|
||||
if shorewall6_is_started ; then
|
||||
[ -d ${VARDIR} ] || mkdir -p ${VARDIR}
|
||||
|
||||
if [ -f $RESTOREPATH -a ! -x $RESTOREPATH ]; then
|
||||
echo " ERROR: $RESTOREPATH exists and is not a saved $PRODUCT configuration" >&2
|
||||
if [ -f $g_restorepath -a ! -x $g_restorepath ]; then
|
||||
echo " ERROR: $g_restorepath exists and is not a saved $PRODUCT configuration" >&2
|
||||
else
|
||||
case $RESTOREFILE in
|
||||
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
|
||||
fi
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
export NOROUTES
|
||||
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
if [ -x ${RESTOREPATH}-ipsets ] ; then
|
||||
if [ -x $g_restorepath ]; then
|
||||
if [ -x ${g_restorepath}-ipsets ] ; then
|
||||
echo Restoring Ipsets...
|
||||
$IP6TABLES -F
|
||||
$IP6TABLES -X
|
||||
$SHOREWALL_SHELL ${RESTOREPATH}-ipsets
|
||||
$SHOREWALL_SHELL ${g_restorepath}-ipsets
|
||||
fi
|
||||
|
||||
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
|
||||
else
|
||||
echo "File $RESTOREPATH: file not found"
|
||||
echo "File $g_restorepath: file not found"
|
||||
[ -n "$nolock" ] || mutex_off
|
||||
exit 2
|
||||
fi
|
||||
|
@ -433,13 +433,13 @@ start_command() {
|
||||
fi
|
||||
|
||||
if [ -n "$g_fast" ]; then
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
if [ -x $g_restorepath ]; then
|
||||
echo Restoring Shorewall6...
|
||||
$SHOREWALL_SHELL $RESTOREPATH restore
|
||||
$SHOREWALL_SHELL $g_restorepath restore
|
||||
date > ${VARDIR}/restarted
|
||||
progress_message3 Shorewall6 restored from $RESTOREPATH
|
||||
progress_message3 Shorewall6 restored from $g_restorepath
|
||||
else
|
||||
do_it
|
||||
fi
|
||||
@ -891,7 +891,7 @@ safe_commands() {
|
||||
;;
|
||||
restart)
|
||||
export RESTOREFILE=.safe
|
||||
RESTOREPATH=${VARDIR}/.safe
|
||||
g_restorepath=${VARDIR}/.safe
|
||||
save_config
|
||||
progress_message3 "Restarting..."
|
||||
;;
|
||||
@ -1028,7 +1028,7 @@ try_command() {
|
||||
;;
|
||||
restart)
|
||||
export RESTOREFILE=.try
|
||||
RESTOREPATH=${VARDIR}/.try
|
||||
g_restorepath=${VARDIR}/.try
|
||||
save_config
|
||||
progress_message3 "Restarting..."
|
||||
;;
|
||||
@ -1714,7 +1714,7 @@ case "$COMMAND" in
|
||||
;;
|
||||
esac
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
[ -n "$nolock" ] || mutex_on
|
||||
|
||||
@ -1740,21 +1740,20 @@ case "$COMMAND" in
|
||||
;;
|
||||
esac
|
||||
|
||||
g_restorepath=${VARDIR}/$RESTOREFILE
|
||||
|
||||
RESTOREPATH=${VARDIR}/$RESTOREFILE
|
||||
if [ -x $g_restorepath ]; then
|
||||
|
||||
if [ -x $RESTOREPATH ]; then
|
||||
|
||||
if [ -x ${RESTOREPATH}-ipsets ]; then
|
||||
rm -f ${RESTOREPATH}-ipsets
|
||||
echo " ${RESTOREPATH}-ipsets removed"
|
||||
if [ -x ${g_restorepath}-ipsets ]; then
|
||||
rm -f ${g_restorepath}-ipsets
|
||||
echo " ${g_restorepath}-ipsets removed"
|
||||
fi
|
||||
|
||||
rm -f $RESTOREPATH
|
||||
rm -f ${RESTOREPATH}-iptables
|
||||
echo " $RESTOREPATH removed"
|
||||
elif [ -f $RESTOREPATH ]; then
|
||||
echo " $RESTOREPATH exists and is not a saved Shorewall6 configuration"
|
||||
rm -f $g_restorepath
|
||||
rm -f ${g_restorepath}-iptables
|
||||
echo " $g_restorepath removed"
|
||||
elif [ -f $g_restorepath ]; then
|
||||
echo " $g_restorepath exists and is not a saved Shorewall6 configuration"
|
||||
fi
|
||||
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">RESTOREPATH</emphasis></member>
|
||||
<member>RESTOREPATH</member>
|
||||
|
||||
<member>RING_BELL</member>
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
|
||||
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
||||
|
||||
<member><emphasis role="bold">RESTOREPATH</emphasis></member>
|
||||
<member>RESTOREPATH</member>
|
||||
|
||||
<member>RING_BELL</member>
|
||||
|
||||
|
@ -67,7 +67,7 @@
|
||||
|
||||
<member><emphasis role="bold">RECOVERING</emphasis></member>
|
||||
|
||||
<member><emphasis role="bold">RESTOREPATH</emphasis></member>
|
||||
<member>RESTOREPATH</member>
|
||||
|
||||
<member>RING_BELL</member>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user