Tiny Core Linux

Tiny Core Base => TCB Tips & Tricks => Topic started by: gwalther on November 18, 2009, 01:06:19 PM

Title: Play sound when wireless network found?
Post by: gwalther on November 18, 2009, 01:06:19 PM
I try and connect to a wireless network...on boot...using commands in ../opt/bootlocal.sh
The last command is:

udhcpc -b -i wlan0

Is there a way to play  a wav file  (using aplay)... if a successful connection is made?

Title: Re: Play sound when wireless network found?
Post by: Jason W on November 18, 2009, 01:10:18 PM
Not on TC to test it, but one of these may work.  Either

udhcpc -b -i wlan0 && aplay file.wav

or the below placed after the dhcp command:
 


if [ "$?" -eq "0" ];then
  aplay file.wav
fi

One of those would work in general use, but with detecting connectivity there may be more to it, like using iwconfig and grepping output.
Title: Re: Play sound when wireless network found?
Post by: gwalther on November 18, 2009, 04:44:41 PM
Thanks....tried the second solution and it seems to work.  I hear wav file about 12 secs after the desktop first appears....system had connected.  Need to test some more, when system is not available and/or fails to connect.