Firmware selector customize web server

i have created a script and pasted it into the customization of the firmware. i think that i am missing something, as it does not install the lighttpd.
here are the commands that i have pasted into the section for customization

#!/bin/sh
# /etc/rc.local

# Update package list and install Lighttpd
opkg update
opkg install lighttpd

# Modify the Lighttpd configuration
cat << EOF > /etc/lighttpd/lighttpd.conf
server.document-root = "/srv/www/"
server.port = 81
dir-listing.activate = "enable"
EOF

# Create the document root directory
mkdir -p /srv/www

# Add a test HTML file
echo "<html><body><h1>It works!</h1></body></html>" > /srv/www/index.html

# Ensure Lighttpd starts on boot
/etc/init.d/lighttpd enable
/etc/init.d/lighttpd start

exit 0

what am i missing?