Lines 252-258
show_one_classifier() {
Link Here
|
252 |
|
252 |
|
253 |
qt tc -s filter ls root dev $1 && tc -s filter ls root dev $device | grep -v '^$' |
253 |
qt tc -s filter ls root dev $1 && tc -s filter ls root dev $device | grep -v '^$' |
254 |
tc filter show dev $1 |
254 |
tc filter show dev $1 |
255 |
tc class show dev $1 | fgrep 'leaf ' | fgrep -v ' hfsc' | sed 's/^.*leaf //;s/ .*//' | while read class; do |
255 |
tc class show dev $1 | grep -F 'leaf ' | grep -F -v ' hfsc' | sed 's/^.*leaf //;s/ .*//' | while read class; do |
256 |
if [ -n "$class" ]; then |
256 |
if [ -n "$class" ]; then |
257 |
echo |
257 |
echo |
258 |
echo Node $class |
258 |
echo Node $class |
Lines 426-432
resolve_arptables() {
Link Here
|
426 |
savesets() { |
426 |
savesets() { |
427 |
local supported |
427 |
local supported |
428 |
|
428 |
|
429 |
supported=$(run_it $g_firewall help | fgrep savesets ) |
429 |
supported=$(run_it $g_firewall help | grep -F savesets ) |
430 |
|
430 |
|
431 |
[ -n "$supported" ] && run_it $g_firewall savesets ${g_restorepath}-ipsets |
431 |
[ -n "$supported" ] && run_it $g_firewall savesets ${g_restorepath}-ipsets |
432 |
} |
432 |
} |
Lines 437-443
savesets() {
Link Here
|
437 |
savesets1() { |
437 |
savesets1() { |
438 |
local supported |
438 |
local supported |
439 |
|
439 |
|
440 |
supported=$(run_it $g_firewall help | fgrep savesets ) |
440 |
supported=$(run_it $g_firewall help | grep -F savesets ) |
441 |
|
441 |
|
442 |
[ -n "$supported" ] && run_it $g_firewall savesets ${VARDIR}/ipsets.save && progress_message3 "The ipsets have been saved to ${VARDIR}/ipsets.save" |
442 |
[ -n "$supported" ] && run_it $g_firewall savesets ${VARDIR}/ipsets.save && progress_message3 "The ipsets have been saved to ${VARDIR}/ipsets.save" |
443 |
} |
443 |
} |
Lines 696-702
find_sets() {
Link Here
|
696 |
local junk |
696 |
local junk |
697 |
local setname |
697 |
local setname |
698 |
|
698 |
|
699 |
$IPSETN -L | egrep "^Name: ${1}(_.+)?$" | while read junk setname; do echo $setname; done |
699 |
$IPSETN -L | grep -E "^Name: ${1}(_.+)?$" | while read junk setname; do echo $setname; done |
700 |
} |
700 |
} |
701 |
|
701 |
|
702 |
list_zone() { |
702 |
list_zone() { |
Lines 707-715
list_zone() {
Link Here
|
707 |
determine_ipset_version |
707 |
determine_ipset_version |
708 |
|
708 |
|
709 |
if [ $g_family -eq 4 ]; then |
709 |
if [ $g_family -eq 4 ]; then |
710 |
sets=$($IPSETN -L | egrep "^$1(_.+)?"); |
710 |
sets=$($IPSETN -L | grep -E "^$1(_.+)?"); |
711 |
else |
711 |
else |
712 |
sets=$($IPSETN -L | egrep "^6_$1(_.+)?") |
712 |
sets=$($IPSETN -L | grep -E "^6_$1(_.+)?") |
713 |
fi |
713 |
fi |
714 |
|
714 |
|
715 |
[ -n "$sets" ] || sets=$(find_sets $1) |
715 |
[ -n "$sets" ] || sets=$(find_sets $1) |
Lines 1207-1213
show_ipsec() {
Link Here
|
1207 |
$IP -s -$g_family xfrm policy | spd_filter |
1207 |
$IP -s -$g_family xfrm policy | spd_filter |
1208 |
|
1208 |
|
1209 |
heading "PFKEY SAD" |
1209 |
heading "PFKEY SAD" |
1210 |
$IP -s -$g_family xfrm state | egrep -v '[[:space:]]+(auth-trunc|enc )' # Don't divulge the keys |
1210 |
$IP -s -$g_family xfrm state | grep -E -v '[[:space:]]+(auth-trunc|enc )' # Don't divulge the keys |
1211 |
} |
1211 |
} |
1212 |
|
1212 |
|
1213 |
show_ipsec_command() { |
1213 |
show_ipsec_command() { |
Lines 1533-1539
show_command() {
Link Here
|
1533 |
if chain_exists dynamic; then |
1533 |
if chain_exists dynamic; then |
1534 |
g_ipt_options="$g_ipt_options --line-numbers" |
1534 |
g_ipt_options="$g_ipt_options --line-numbers" |
1535 |
$g_tool -t filter -L dynamic $g_ipt_options | head -n2 |
1535 |
$g_tool -t filter -L dynamic $g_ipt_options | head -n2 |
1536 |
$g_tool -t filter -L dynamic $g_ipt_options | fgrep ACCEPT | $output_filter |
1536 |
$g_tool -t filter -L dynamic $g_ipt_options | grep -F ACCEPT | $output_filter |
1537 |
fi |
1537 |
fi |
1538 |
;; |
1538 |
;; |
1539 |
ipsec) |
1539 |
ipsec) |
Lines 1625-1631
perip_accounting() {
Link Here
|
1625 |
|
1625 |
|
1626 |
if [ -n "$hnames" ]; then |
1626 |
if [ -n "$hnames" ]; then |
1627 |
for hname in $hnames; do |
1627 |
for hname in $hnames; do |
1628 |
iptaccount -l $hname | egrep '^IP:|^Show' |
1628 |
iptaccount -l $hname | grep -E '^IP:|^Show' |
1629 |
echo |
1629 |
echo |
1630 |
done |
1630 |
done |
1631 |
else |
1631 |
else |
Lines 3253-3259
determine_capabilities() {
Link Here
|
3253 |
|
3253 |
|
3254 |
if $TC filter add basic help 2>&1 | grep -q ^Usage; then |
3254 |
if $TC filter add basic help 2>&1 | grep -q ^Usage; then |
3255 |
BASIC_FILTER=Yes |
3255 |
BASIC_FILTER=Yes |
3256 |
$TC filter add basic help 2>&1 | egrep -q match && BASIC_EMATCH=Yes |
3256 |
$TC filter add basic help 2>&1 | grep -E -q match && BASIC_EMATCH=Yes |
3257 |
fi |
3257 |
fi |
3258 |
|
3258 |
|
3259 |
if $TC action add connmark help 2>&1 | grep -q ^Usage; then |
3259 |
if $TC action add connmark help 2>&1 | grep -q ^Usage; then |
Lines 3674-3680
blacklist_command() {
Link Here
|
3674 |
if [ $COMMAND = 'blacklist!' ]; then |
3674 |
if [ $COMMAND = 'blacklist!' ]; then |
3675 |
timeout='timeout 0' |
3675 |
timeout='timeout 0' |
3676 |
else |
3676 |
else |
3677 |
echo "$@" | fgrep -q ' timeout ' || timeout="timeout $g_dbltimeout" |
3677 |
echo "$@" | grep -F -q ' timeout ' || timeout="timeout $g_dbltimeout" |
3678 |
fi |
3678 |
fi |
3679 |
|
3679 |
|
3680 |
if $IPSET -A $g_blacklistipset $@ $timeout -exist; then |
3680 |
if $IPSET -A $g_blacklistipset $@ $timeout -exist; then |
Lines 4932-4943
shorewall_cli() {
Link Here
|
4932 |
# |
4932 |
# |
4933 |
# First look for it here |
4933 |
# First look for it here |
4934 |
# |
4934 |
# |
4935 |
if type $1 2> /dev/null | fgrep -q 'is a function'; then |
4935 |
if type $1 2> /dev/null | grep -F -q 'is a function'; then |
4936 |
# |
4936 |
# |
4937 |
# It's a shell function -- call it |
4937 |
# It's a shell function -- call it |
4938 |
# |
4938 |
# |
4939 |
$@ |
4939 |
$@ |
4940 |
elif type $1 2> /dev/null | fgrep -q 'is a shell function'; then |
4940 |
elif type $1 2> /dev/null | grep -F -q 'is a shell function'; then |
4941 |
# |
4941 |
# |
4942 |
# It's a shell function -- call it |
4942 |
# It's a shell function -- call it |
4943 |
# |
4943 |
# |