Wireless shell script - device folder does not exist

Bug #19358 reported by Jemt
12
Affects Status Importance Assigned to Milestone
acpi-support (Ubuntu)
Fix Released
Medium
Registry Administrators

Bug Description

There seems to be an error in the shell script /etc/acpi/wireless.sh

The script enumerated through a collection of devices in '/sys/class/net/' to
check if any of them contains a folder called 'wireless'. If such a folder
exists it should be a wireless network device. But this folder does not exist.

if [ -d $DEVICE/wireless ]; then ......

My devices :

/sys/class/net/eth0
/sys/class/net/eth1 # This is my wireless network - countains no 'wireless'
folder.
/sys/class/net/lo
/sys/class/net/sit0
/sys/class/net/wifi0

/sys/class/net/eth1/device/power/state # My 'state' file exists within the
correct directory

I solved the problem with one of my own shell scripts - not generic though as
you haft to specify the path to your own state file :

------------------------------------------------------------------------------------------------

#!/bin/bash
# Turn wireless on/off

# Specify your network device state file
dev_state="/sys/class/net/eth1/device/power/state"

echo

if [ -f $dev_state ] # Checking that state file exists
then
 if [ -G $dev_state ] # Checking that the user has permission to read from the file
 then
  if [ `cat $dev_state` = 0 ] # If true, wireless is turned on
  then
   echo -n 3 > $dev_state # Wireless turned off
   echo "Wireless turned off [\"ok\"]"
  else
   echo -n 0 > $dev_state # Wireless turned on
   echo "Wireless turned on [\"ok\"]"
  fi
 else
  echo "Permission denied - try as root [\"fail\"]"
 fi
else
 echo "Device state does not exist! [\"fail\"]"
fi

echo

Revision history for this message
Lakin Wecker (lakin) wrote :

Thanks for your bug-report. Unfortunately, it doesn't contain enough information for us to debug the problem.

The most important piece of information is the version of Ubuntu and the version of the acpi-support package that you are using. Next it would be most helpful if you could test with the latest Ubuntu Dapper Beta Release to see if the problem still exists.

I'm marking this bug as needs info until this information is provided. Please feel free to re-open the bug if the problem still exists and you've provided the necessary version information.

Revision history for this message
Paul Sladen (sladen) wrote :

This should be fixed in Dapper after some of the drivers were fixed in the kernel.

Changed in acpi-support:
status: Needs Info → Fix Released
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.