Fix the wrong device registered in netstatus applet, and automatically set it to the first working network connection.

Bug #42100 reported by Joel Bryan Juliano
10
Affects Status Importance Assigned to Milestone
gnome-netstatus
Won't Fix
Medium
gnome-netstatus (Ubuntu)
Won't Fix
Wishlist
Unassigned

Bug Description

On machines that have multiple NIC's, sometimes network applet displays the wrong information.

This fixes the netstatus applet to use the correct interfaces.

Interfaces can be eth, or sit.

I include a script with this bug:

#!/bin/sh
# Find the first working network connection and
# configures it in netstatus applet.
#
# Joel Bryan T. Juliano <email address hidden>

link="`/sbin/ifconfig | sed -e '/./{H;$!d;}' -e 'x;/[a-zA-Z][a-zA-Z][a-zA-Z]/!d;/RUNNING/!d;' \
       | sed '/^[a-zA-Z][a-zA-Z][a-zA-Z]/!d' | sed -n '/^.\{15\}/p' | \
       sed -ne 's/\([a-zA-Z][a-zA-Z][a-zA-Z][[:digit:]]\).*/\1/p'`"

/usr/bin/gconftool-2 -t string -s /apps/panel/applets/applet_0/prefs/interface "$link"

Revision history for this message
Joel Bryan Juliano (joelbryan) wrote :

I have made a better version, that test if the currently set interface in netstatus applet is really working or not.

#!/bin/sh
# Find the first working network connection and
# configures it.
#
# Joel Bryan T. Juliano <email address hidden>

link="`/sbin/ifconfig | sed -e '/./{H;$!d;}' -e 'x;/[a-zA-Z][a-zA-Z][a-zA-Z]/!d;/RUNNING/!d;' \
       | sed '/^[a-zA-Z][a-zA-Z][a-zA-Z]/!d' | sed -n '/^.\{15\}/p' | \
       sed -ne 's/\([a-zA-Z][a-zA-Z][a-zA-Z][[:digit:]]\).*/\1/p'`"

current_link="`/usr/bin/gconftool-2 -g /apps/panel/applets/applet_0/prefs/interface`"

if [ ! "$link" = "$current_link" ]
then

test_current_link="`/sbin/ifconfig | sed -e '/./{H;$!d;}' -e 'x;/'$current_link'/!d;/RUNNING/!d;' \
       | sed '/^[a-zA-Z][a-zA-Z][a-zA-Z]/!d' | sed -n '/^.\{15\}/p' | \
       sed -ne 's/\([a-zA-Z][a-zA-Z][a-zA-Z][[:digit:]]\).*/\1/p'`"

 if [ -s $test_current_link ]
 then
 /usr/bin/gconftool-2 -t string -s /apps/panel/applets/applet_0/prefs/interface "$link"
 fi
exit 0;
fi

Revision history for this message
Joel Bryan Juliano (joelbryan) wrote :

Oops, made some typo, here is the correct version.

#!/bin/sh
# Find the first working network connection and
# configures it.
#
# Joel Bryan T. Juliano <email address hidden>

link="`/sbin/ifconfig | sed -e '/./{H;$!d;}' -e 'x;/[a-zA-Z][a-zA-Z][a-zA-Z]/!d;/RUNNING/!d;' \
       | sed '/^[a-zA-Z][a-zA-Z][a-zA-Z]/!d' | sed -n '/^.\{15\}/p' | \
       sed -ne 's/\([a-zA-Z][a-zA-Z][a-zA-Z][[:digit:]]\).*/\1/p'`"

current_link="`/usr/bin/gconftool-2 -g /apps/panel/applets/applet_0/prefs/interface`"

if [ ! "$link" = "$current_link" ]
then

test_current_link="`/sbin/ifconfig | sed -e '/./{H;$!d;}' -e 'x;/'$current_link'/!d;/RUNNING/!d;' \
       | sed '/^[a-zA-Z][a-zA-Z][a-zA-Z]/!d' | sed -n '/^.\{15\}/p' | \
       sed -ne 's/\([a-zA-Z][a-zA-Z][a-zA-Z][[:digit:]]\).*/\1/p'`"

 if [ ! -s "$test_current_link" ]
 then
 /usr/bin/gconftool-2 -t string -s /apps/panel/applets/applet_0/prefs/interface "$link"
 fi

exit 0;
fi

Revision history for this message
Joel Bryan Juliano (joelbryan) wrote : The better version, w/ typo fixed.

bash script that sets the correct interface for the netstatus applet.

Revision history for this message
Andy Price (andy-price) wrote :

Thanks for your bug report. I am changing the source package to gnome-netstatus-applet as changes are most likely to be made in that package.

Revision history for this message
Alexandre Otto Strube (surak) wrote :

Malone says: "There is no current release for this source package in Ubuntu": "gnome-netstatus-applet"

I'm changing to gnome-netstatus.

Changed in ubuntu-meta:
status: Unconfirmed → Rejected
Changed in gnome-netstatus:
assignee: nobody → desktop-bugs
Revision history for this message
Daniel Holbach (dholbach) wrote :

Maybe somebody should ask upstream to integrate it somehow?

Revision history for this message
Pedro Villavicencio (pedro) wrote :

any news about this? upstream is now maintaining the applet, it'd be a good time to send this upstream, could somebody send it there? thanks.

Daniel T Chen (crimsun)
Changed in gnome-netstatus:
importance: Medium → Wishlist
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

I've reported the bug upstream. Please attach patches and script to the upstream bug as I cannot reproduce this issue myself.

Changed in gnome-netstatus:
importance: Undecided → Unknown
status: New → Unknown
Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

Marked as confirmed because reported upstream with a fix.

Changed in gnome-netstatus:
status: New → Confirmed
Changed in gnome-netstatus:
status: Unknown → New
Changed in gnome-netstatus (Ubuntu):
status: Confirmed → Triaged
assignee: Ubuntu Desktop Bugs (desktop-bugs) → nobody
Changed in gnome-netstatus:
importance: Unknown → Medium
Changed in gnome-netstatus:
status: New → Won't Fix
no longer affects: ubuntu-meta (Ubuntu)
Changed in gnome-netstatus (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.