Modify

Opened 8 years ago

Closed 8 years ago

#3190 closed defect (worksforme)

/etc/init.d/olsrd little bug in Interface configuration

Reported by: fofware@… Owned by: developers
Priority: normal Milestone:
Component: packages Version:
Keywords: Cc:

Description

I did add an "if" to solve the problem

foreach_Interface() {

local cfg="$1"
local interfaces
local interface
local ifname
local option
local value
local item
local c

config_get interfaces "$cfg" Interface

if [ -n "$interfaces" ]; then

echo -n "Interface" >> "$CONF_F"

for interface in $interfaces
do

interface=$(format_uci_varname "$interface")
config_get ifnames "$interface" ifname
for ifname in $ifnames
do

ifname=$(format_olsr_param "$ifname")
echo -n " \"$ifname\"" >> "$CONF_F"

done

done

echo >> "$CONF_F"
echo -n "{" >> "$CONF_F"

for option in $CONFIG_OPTIONS
do

config_get value "$cfg" "$option"
option=$(format_olsr_option "$option")
value=$(format_olsr_value "$value")

if [ -n "$value" ]; then

if [ "$option" != "ifname" ]; then ### this is the if needed
if [ "$option" = "LinkQualityMult" ]; then

c=0
for item in $value
do

if [ $((c % 2)) -eq 0 ]; then

echo >> "$CONF_F"
echo -n " $option $item" >> "$CONF_F"

else

echo -n " $item" >> "$CONF_F"

fi
c=$((c + 1))

done

elif [ "$option" != "Interface" ]; then

echo >> "$CONF_F"
echo -n " $option $value" >> "$CONF_F"

fi
fi ### Close the if needed

fi

done

echo >> "$CONF_F"
echo "}" >> "$CONF_F"

fi

}

Sorry I don't explain with words, but I guess this way is more clear than English I can write

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by anonymous

Please submit a diff (cd trunk/feeds/packages/net/olsrd/files/; svn diff olsrd.init) and attach that file to the ticket.

Your current unformatted code is really hard to read...

comment:2 Changed 8 years ago by anonymous

cd trunk/feeds/packages/net/olsrd/files/; svn diff olsrd.init > olsrd.diff

comment:3 Changed 8 years ago by Acinonyx

Can you please specify what is the problem exactly?

comment:4 Changed 8 years ago by florian

  • Resolution set to worksforme
  • Status changed from new to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.