mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-10 16:40:03 +00:00
ebtables: Remove bashisms
Removes the bashism of prefacing shell functions with "function" and renames the clear function to not conflict with the command of the same name. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
This commit is contained in:
committed by
Joe MacDonald
parent
ea97f6b7db
commit
1bf1cfab46
@@ -20,7 +20,7 @@ EBTABLES_BACKUP_SUFFIX="~"
|
|||||||
config=/etc/default/$prog
|
config=/etc/default/$prog
|
||||||
[ -f "$config" ] && . "$config"
|
[ -f "$config" ] && . "$config"
|
||||||
|
|
||||||
function get_supported_tables() {
|
get_supported_tables() {
|
||||||
EBTABLES_SUPPORTED_TABLES=
|
EBTABLES_SUPPORTED_TABLES=
|
||||||
/sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission
|
/sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@@ -35,7 +35,7 @@ function get_supported_tables() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function load() {
|
load() {
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
get_supported_tables
|
get_supported_tables
|
||||||
echo -n "Restoring ebtables rulesets: "
|
echo -n "Restoring ebtables rulesets: "
|
||||||
@@ -64,7 +64,7 @@ function load() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function clear() {
|
clear_rules() {
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
get_supported_tables
|
get_supported_tables
|
||||||
echo -n "Clearing ebtables rulesets: "
|
echo -n "Clearing ebtables rulesets: "
|
||||||
@@ -90,7 +90,7 @@ function clear() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
save() {
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
get_supported_tables
|
get_supported_tables
|
||||||
echo -n "Saving ebtables rulesets: "
|
echo -n "Saving ebtables rulesets: "
|
||||||
@@ -127,11 +127,11 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
[ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
|
[ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save
|
||||||
clear
|
clear_rules
|
||||||
;;
|
;;
|
||||||
restart|reload|force-reload)
|
restart|reload|force-reload)
|
||||||
[ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
|
[ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save
|
||||||
clear
|
clear_rules
|
||||||
[ "$EBTABLES_LOAD_ON_START" = "yes" ] && load
|
[ "$EBTABLES_LOAD_ON_START" = "yes" ] && load
|
||||||
;;
|
;;
|
||||||
load)
|
load)
|
||||||
|
|||||||
Reference in New Issue
Block a user