Use shell_var for shell variables.
This commit is contained in:
parent
8e5a601087
commit
a2856fe192
@ -164,7 +164,7 @@ runargs()
|
|||||||
|
|
||||||
start()
|
start()
|
||||||
{
|
{
|
||||||
local cr=0 r= int= cmd= args= upcmd=
|
local cr=0 r= int= intv= cmd= args= upcmd=
|
||||||
einfo "Starting network"
|
einfo "Starting network"
|
||||||
routeflush
|
routeflush
|
||||||
if [ "$RC_UNAME" = "Linux" ]; then
|
if [ "$RC_UNAME" = "Linux" ]; then
|
||||||
@ -181,9 +181,10 @@ start()
|
|||||||
eindent
|
eindent
|
||||||
for int in $(interfaces); do
|
for int in $(interfaces); do
|
||||||
local func= cf=
|
local func= cf=
|
||||||
eval upcmd=\$ifup_$int
|
intv=$(shell_var "$int")
|
||||||
|
eval upcmd=\$ifup_$intv
|
||||||
for func in ip ifconfig; do
|
for func in ip ifconfig; do
|
||||||
eval cmd=\$${func}_${int}
|
eval cmd=\$${func}_${intv}
|
||||||
if [ -n "$cmd" -o -f /etc/"$func.$int" ]; then
|
if [ -n "$cmd" -o -f /etc/"$func.$int" ]; then
|
||||||
cf=/etc/"$func.$int"
|
cf=/etc/"$func.$int"
|
||||||
break
|
break
|
||||||
@ -238,14 +239,15 @@ start()
|
|||||||
|
|
||||||
stop()
|
stop()
|
||||||
{
|
{
|
||||||
local int= cmd= downcmd=
|
local int= intv= cmd= downcmd=
|
||||||
einfo "Stopping network"
|
einfo "Stopping network"
|
||||||
routeflush
|
routeflush
|
||||||
eindent
|
eindent
|
||||||
for int in $(reverse $(interfaces u)); do
|
for int in $(reverse $(interfaces u)); do
|
||||||
eval downcmd=\$ifdown_$int
|
intv=$(shell_var "$int")
|
||||||
eval cmd=\$ip_$int
|
eval downcmd=\$ifdown_$intv
|
||||||
[ -z "$cmd" ] && eval cmd=\$ifconfig_$int
|
eval cmd=\$ip_$intv
|
||||||
|
[ -z "$cmd" ] && eval cmd=\$ifconfig_$intv
|
||||||
if [ -n "$cmd" -o -f /etc/ip."$int" -o \
|
if [ -n "$cmd" -o -f /etc/ip."$int" -o \
|
||||||
-f /etc/ifconfig."$int" -o \
|
-f /etc/ifconfig."$int" -o \
|
||||||
-n "$downcmd" -o -f /etc/ifdown."$int" ];
|
-n "$downcmd" -o -f /etc/ifdown."$int" ];
|
||||||
|
Loading…
Reference in New Issue
Block a user