Installing "Speak IP address on boot

From Projects Wiki
Jump to: navigation, search

Speak IP address on boot

When the Pi uses DHCP to obtain an IP address it can be difficult to determine the address that was assigned. This script will use espeak to have the Pi speak its IP address when it boots. Just plug in an earphone or other appropriate device into the Pi's audio out, execute this script, and you're good to go.

Compiled and submitted by Ed Schoolcraft

#! /bin/sh

sudo apt-get install -y espeak 

cat > <<DELIM
#! /bin/sh
sleep 2;
private=\`hostname -I\`
string="i p address is \$private"
echo \$string | espeak -a 20 -s 160 -v en-us 2>\/dev\/null
sleep 2;
echo \$string | espeak -a 20 -s 160 -v en-us 2>\/dev\/null
exit 0

sudo chmod +x
sudo mv /etc/

sudo perl -i.bak -pe 's/^exit 0\b*$/\/etc\/ &\n\nexit 0/g' /etc/rc.local