I can confirm that this will work in rc.local as well.
E.g.
Code:
#!/bin/sh
pool=`nvram get apps_pool`
share=`nvram get apps_share`
internal_hdd=/dev/ide/host2/bus0/target0/lun0/disc
if [ \! -f /tmp/rc.local.done ]; then
# Indicate we've already done this
touch /tmp/rc.local.done
#
# Mount /opt and connect in various system files
#
if [ -e /shares/${pool}/opt ]; then
mount -o bind /shares/${pool}/opt /opt
cat /proc/mounts > /opt/etc/fstab
ln -s /opt/etc/shells /tmp/shells
ln -s /opt/etc/fstab /tmp/fstab
export PATH=/opt/bin:/opt/sbin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
fi
# Start utelnetd on local interface only!
/apps/bin/utelnetd -i br0 &
# Sleep for a little bit to not interfere with normal system startup
# before we kill a bunch of Asus processes.
sleep 5
# The killing of watchdog is necessary
# to allow the disk to spin down (watchdog is a horribly written hack
# anyway!)
killall -q -9 watchdog
# Do the necessary steps so the internal HDD will spin down
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}
# Add confirmation that rc.local was executed
echo "rc.local executed" | logger -p local0.notice
fi