Browse Source

tags/v2.01a1
bbruns@gmail.com 7 years ago
parent
commit
d9b26ba039
2 changed files with 37 additions and 7 deletions
  1. +21
    -2
      bin/srfirewall
  2. +16
    -5
      lib/display.inc

+ 21
- 2
bin/srfirewall View File

@@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# Static config options, normally do not need to change
FW_VERSION="2.0"
FW_VERSION="2.0 PreAlpha 1"

# Important directory locations
FWPREFIX="/usr/local"
@@ -47,6 +47,8 @@ if (( ${BASH_VERSINFO[0]} <= "2" )); then
exit 1
fi



# Swap out display_c command for dummy command if they don't want
# output when command is run.
if [ "${DisplayDetailedOutput}" == "yes" ]; then
@@ -59,7 +61,7 @@ if [ "${DisplayDetailedOutput}" == "yes" ]; then
display="true"
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.
if [ "${DisplayDebugInfo}" == "yes" ]; then
if [ "${ColorizeOut}" == "yes" ]; then
@@ -71,6 +73,23 @@ else
debug="true"
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
# ${display} RED "You must be root to run this script."
# exit 2


+ 16
- 5
lib/display.inc View File

@@ -85,8 +85,19 @@ function reset_color {
# show_help
# Show command line options help
function show_help {
echo "Firewall/SOSDG ${FW_VERSION} - Brielle Bruns <bruns@2mbit.com>"
echo -e "\t--help\t\tShows this info"
echo -e "\t--flush\t\tFlushes all rules back to default ACCEPT"
echo -e "\t--generate-cache\tGenerate cached rule file"
}
${display} DEFAULT_COLOR "SRFirewall ${FW_VERSION}"
${display} DEFAULT_COLOR "\n${0} -[fghv]\n"
${display} DEFAULT_COLOR "\t-f\tFlushes all rules back to default ACCEPT"
${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…
Cancel
Save