Article 4Q1ZD Bash script not work properly from rc.local

Bash script not work properly from rc.local

by
mackowiakp
from LinuxQuestions.org on (#4Q1ZD)
I try to run the script below from Ubuntu "rc.local" file. The file /home/pi/ramdisk/ESP is created correctly but "while" loop seam to not work.
The same script run from CLI or cron, works properly. Any idea what I am doing wrong?

Code:#!/bin/bash

touch /home/pi/domoticz/ESP.conf
cat /home/pi/domoticz/ESP.conf|sed '/^#/ d' > /home/pi/ramdisk/ESP
[ ! -f /home/pi/ramdisk/domoticz_on ] && exit
case $1 in
reboot_off)
event="reboot_off"
;;
reboot_on)
event="reboot_on"
;;
*)
event="alive"
;;
esac
while read ip
do
wget -q -P /home/pi/ramdisk --delete-after --connect-timeout=2 --tries=5 "http://$ip/control?cmd=event,$event" > /dev/null
done < /home/pi/ramdisk/ESPlatest?d=yIl2AUoC8zA latest?i=qc9M6DIxXU0:he_7XJIoANM:F7zBnMy latest?i=qc9M6DIxXU0:he_7XJIoANM:V_sGLiP latest?d=qj6IDK7rITs latest?i=qc9M6DIxXU0:he_7XJIoANM:gIN9vFwqc9M6DIxXU0
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments