mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 14:20:40 +01:00
Fail if the rc file can not be loaded
Signed-off-by: Matt Darfeuille <matdarf@gmail.com> Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
a9048b63f2
commit
f6f7e691d0
@ -104,14 +104,14 @@ done
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
file=./shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
file=~/.shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
file=/usr/share/shorewall/shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -125,7 +125,7 @@ elif [ $# -eq 1 ]; then
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -52,11 +52,11 @@ cd "$(dirname $0)"
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -66,11 +66,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -114,17 +114,17 @@ done
|
||||
# Read the RC file
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
#
|
||||
# Load packager's settings if any
|
||||
#
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc || exit 1
|
||||
file=./shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
file=~/.shorewallrc
|
||||
else
|
||||
fatal_error "No configuration file specified and ~/.shorewallrc not found"
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
file=/usr/share/shorewall/shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
elif [ $# -eq 1 ]; then
|
||||
file=$1
|
||||
@ -132,11 +132,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -83,16 +83,17 @@ while [ $finished -eq 0 ]; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
#
|
||||
# Read the RC file
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -102,11 +103,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file || exit 1
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -116,12 +116,14 @@ done
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc || exit 1
|
||||
file=./shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc
|
||||
file=~/.shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
file=/usr/share/shorewall/shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -131,11 +133,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -87,16 +87,17 @@ while [ $finished -eq 0 ]; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
#
|
||||
# Read the RC file
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -106,11 +107,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -129,11 +129,14 @@ done
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
file=./shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
file=~/.shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
file=/usr/share/shorewall/shorewallrc
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -143,11 +146,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -88,13 +88,16 @@ while [ $finished -eq 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
#
|
||||
# Read the RC file
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -104,11 +107,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -83,16 +83,17 @@ while [ $finished -eq 0 ]; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
#
|
||||
# Read the RC file
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -102,11 +103,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
@ -89,11 +89,11 @@ done
|
||||
#
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ -f ./shorewallrc ]; then
|
||||
. ./shorewallrc
|
||||
. ./shorewallrc || fatal_error "Can not load the RC file: ./shorewallrc"
|
||||
elif [ -f ~/.shorewallrc ]; then
|
||||
. ~/.shorewallrc || exit 1
|
||||
. ~/.shorewallrc || fatal_error "Can not load the RC file: ~/.shorewallrc"
|
||||
elif [ -f /usr/share/shorewall/shorewallrc ]; then
|
||||
. /usr/share/shorewall/shorewallrc
|
||||
. /usr/share/shorewall/shorewallrc || fatal_error "Can not load the RC file: /usr/share/shorewall/shorewallrc"
|
||||
else
|
||||
fatal_error "No configuration file specified and /usr/share/shorewall/shorewallrc not found"
|
||||
fi
|
||||
@ -103,11 +103,11 @@ elif [ $# -eq 1 ]; then
|
||||
/*|.*)
|
||||
;;
|
||||
*)
|
||||
file=./$file
|
||||
file=./$file || exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
. $file
|
||||
. $file || fatal_error "Can not load the RC file: $file"
|
||||
else
|
||||
usage 1
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user