Here's my startup script. For some reason it causes the web pages to get screwed up. Sections repeat themselves. For example under Services->NAS all sections are repeated. I've been systematically removing sections of the script to see if I could narrow it down but after 2 hours I'm giving up. Anyone have any insite?
(
CNT=30
echo "Waiting for modules to initialize disk access..."
while [ $CNT -gt 0 ]; do
if [ -e /dev/discs/disc0/part2 ] && [ -e /dev/discs/disc0/part3 ] && [ -e /dev/discs/disc0/part4 ]; then
sleep 5
echo "Mounting disk partitions..."
mount -t ext3 -o noatime /dev/discs/disc0/part2 /jffs
mount -t ext3 -o noatime /dev/discs/disc0/part3 /opt
mount -t ext3 -o noatime /dev/discs/disc0/part4 /mmc
echo "Enabling JFFS..."
nvram set sys_enable_jffs2=1
echo "Mounting others..."
mount -o bind /jffs/etc /etc
echo "Starting Optware programs..."
if [ -x /opt/etc/init.d/rcS ]; then
/opt/etc/init.d/rcS
fi
echo "Startup complete!!"
exit 0
else
echo "($CNT) Sleeping waiting for USB disc..."
sleep 1
CNT=$(($CNT-1))
fi
done
) > /tmp/optware.log 2>&1
This is because of this line:
mount -o bind /jffs/etc /etc
Once you do this dd-wrt will include all .webx (e.g. yxz.webnas) scripts twice.
Since it is checking for web pages in /etc/config and /jffs/etc/config
Thx Kong!
Updated to:
(
CNT=30
echo "Waiting for modules to initialize disk access..."
while [ $CNT -gt 0 ]; do
if [ -e /dev/discs/disc0/part4 ]; then
sleep 1
echo "Mounting disk partitions..."
mount -t ext3 -o noatime /dev/discs/disc0/part4 /mnt
echo "Mounting directories..."
mount -o bind /mnt/etc /etc
mount -o bind /mnt/jffs /jffs
mount -o bind /mnt/opt /opt
mount -o bind /mnt/mmc /mmc
echo "Enabling JFFS..."
nvram set sys_enable_jffs2=1
echo "Starting Optware programs..."
if [ -x /opt/etc/init.d/rcS ]; then
/opt/etc/init.d/rcS
fi
echo "Startup complete!!"
exit 0
else
echo "($CNT) Sleeping waiting for USB disc..."
sleep 1
CNT=$(($CNT-1))
fi
done
) > /tmp/optware.log 2>&1