master
parent
a8aaa23834
commit
d9b26ba039
|
@ -19,7 +19,7 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# Static config options, normally do not need to change
|
# Static config options, normally do not need to change
|
||||||
FW_VERSION="2.0"
|
FW_VERSION="2.0 PreAlpha 1"
|
||||||
|
|
||||||
# Important directory locations
|
# Important directory locations
|
||||||
FWPREFIX="/usr/local"
|
FWPREFIX="/usr/local"
|
||||||
|
@ -47,6 +47,8 @@ if (( ${BASH_VERSINFO[0]} <= "2" )); then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Swap out display_c command for dummy command if they don't want
|
# Swap out display_c command for dummy command if they don't want
|
||||||
# output when command is run.
|
# output when command is run.
|
||||||
if [ "${DisplayDetailedOutput}" == "yes" ]; then
|
if [ "${DisplayDetailedOutput}" == "yes" ]; then
|
||||||
|
@ -59,7 +61,7 @@ if [ "${DisplayDetailedOutput}" == "yes" ]; then
|
||||||
display="true"
|
display="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Swap out display_c command for dummy command if they don't want
|
# Swap out debug command for dummy command if they don't want
|
||||||
# debug output when command is run.
|
# debug output when command is run.
|
||||||
if [ "${DisplayDebugInfo}" == "yes" ]; then
|
if [ "${DisplayDebugInfo}" == "yes" ]; then
|
||||||
if [ "${ColorizeOut}" == "yes" ]; then
|
if [ "${ColorizeOut}" == "yes" ]; then
|
||||||
|
@ -71,6 +73,23 @@ else
|
||||||
debug="true"
|
debug="true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Parse command line args
|
||||||
|
while getopts "hfgv" opt; do
|
||||||
|
case $opt in
|
||||||
|
h)
|
||||||
|
show_help
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
v)
|
||||||
|
show_version
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
\?)
|
||||||
|
echo "Invalid option: -$OPTARG" >&2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
#if [ "$UID" != "0" ] && [ "${DebugOverride}" != "yes" ]; then
|
#if [ "$UID" != "0" ] && [ "${DebugOverride}" != "yes" ]; then
|
||||||
# ${display} RED "You must be root to run this script."
|
# ${display} RED "You must be root to run this script."
|
||||||
# exit 2
|
# exit 2
|
||||||
|
|
|
@ -85,8 +85,19 @@ function reset_color {
|
||||||
# show_help
|
# show_help
|
||||||
# Show command line options help
|
# Show command line options help
|
||||||
function show_help {
|
function show_help {
|
||||||
echo "Firewall/SOSDG ${FW_VERSION} - Brielle Bruns <bruns@2mbit.com>"
|
${display} DEFAULT_COLOR "SRFirewall ${FW_VERSION}"
|
||||||
echo -e "\t--help\t\tShows this info"
|
${display} DEFAULT_COLOR "\n${0} -[fghv]\n"
|
||||||
echo -e "\t--flush\t\tFlushes all rules back to default ACCEPT"
|
${display} DEFAULT_COLOR "\t-f\tFlushes all rules back to default ACCEPT"
|
||||||
echo -e "\t--generate-cache\tGenerate cached rule file"
|
${display} DEFAULT_COLOR "\t-g\tGenerate cached rule files (not implemented yet)"
|
||||||
|
${display} DEFAULT_COLOR "\t-h\tShows this help"
|
||||||
|
${display} DEFAULT_COLOR "\t-v\tShow version"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show_version {
|
||||||
|
${display} DEFAULT_COLOR "SRFirewall ${FW_VERSION}"
|
||||||
|
${display} DEFAULT_COLOR "Written by: Brielle Bruns <bruns@2mbit.com>"
|
||||||
|
${display} DEFAULT_COLOR "http://www.sosdg.org/freestuff/firewall"
|
||||||
|
${display} DEFAULT_COLOR "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
|
||||||
|
${display} DEFAULT_COLOR "Released under the GNU GPL Version 3"
|
||||||
|
${display} DEFAULT_COLOR "https://www.gnu.org/licenses/gpl-3.0.txt"
|
||||||
|
}
|
Loading…
Reference in New Issue