Wireless shell script - device folder does not exist
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/
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/
/sys/class/
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=
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
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.