I need to run some post-install configuration commands to change the default PPPoE username and password. I've tried putting them in rc.local but they are not being executed so I then put them in the include file for the build and placed them in /usr/sbin/scriptname. I then have rc.local make it executable before running the script. I've even tried running it from the shell but ash says it can not locate the file even though I'm in the current directory.
I thought it was something to do with building master and possibly gcc not linking correctly so I checked out the 22.03 branch and it still does the same thing.
rc.local
# Put your custom commands here that should be executed once
# the system init is finished. By default this file does nothing.
echo 437500 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
chmod +x /usr/sbin/pppoe-setup
/usr/sbin/pppoe-setup
exit 0
script located at /usr/sbin/pppoe-setup
#!/bin/sh
echo 'Getting WAN Mac Address'
PPPoE_Username=$(cat /sys/class/net/wan/address)
echo $PPPoE_Username
echo 'Configuring WAN link for PPPoE'
uci set network.wan.proto=pppoe
uci set network.wan.username=$PPPoE_Username
uci set network.wan.password=$PPPoE_Username
echo 'Commiting Changes'
uci commit network
echo 'Restarting Network'
service network reload
root@OpenWrt:~# /usr/sbin/pppoe-setup
-ash: /usr/sbin/pppoe-setup: Permission denied