Hi guys,
I'm trying to make my PS3 media server start at system startup. The thing is, the server never starts properly because it is called BEFORE the machine connects to my network. Therefore, I've written a script that is supposed to run at startup and check if I'm connected to my network wirelessly, and THEN start the server. The thing is, I boot up, and I get to my desktop, and the server fails to start, with the log file continually updating with the "Waiting..." message, even though I'm connected to the wireless network. If I go into the terminal, and kill the running script, and then run it again, the script starts the server as expected. Can anyone suggest a reason why the script fails to start the server automatically at startup, but manages to start it when it is run manually post-startup?
#/bin/bash
echo "Started..." > /home/demifuror/log.txt
while :
do
interface=`ifconfig | grep -iE "(wlan0)" | awk '{print$1}'`
if [ $interface == "wlan0" ]; then
break
fi
echo "Waiting...\n" >> /home/demifuror/log.txt
sleep 3
done
echo "Wireless activated..." >> /home/demifuror/log.txt
cd /home/demifuror/Programs/pms-linux-1.10.5
./PMS.sh
echo "Finished..." >> /home/demifuror/log.txt
Thanks