Starting .sh script at boot breaks LED & reboot

Hi, Ive Been Trying To Get A Script I've Put Together To Run At Boot, The Script Runs Placed In /sbin/ When Launched Manually With


Cant Figure Out How To Run This At Boot (the script loops forever so only needs launched once)

Tried Sevaral Things But Just Cant Figure It Out,



######## INFO ########

# OpenWrt: 
# wget: SSL support not available, please install the following 
# libustream-mbedtls

# At The TOP Edit Your Account Type & Add Email & Password

# Account Type:
# 1 = BT Home Broadband
# 2 = BT Wi-Fi Account
# 3 = BT Buisness Broadband

######## settings ########


######## OPTIONAL ########


######## DO NOT EDIT BELOW HERE ########

while :
pingtime=$(ping -w 1 $PINGDNS | grep ttl)
if [ "$pingtime" = "" ] 
   pingtimetwo=$(ping -w 1 $PING2URL | grep ttl) 
   if [ "$pingtimetwo" = "" ] 
   echo "Offline, Attempting Login"
		if [ "$ACCOUNTTYPE" = "1" ]
		wget --no-check-certificate -T 2 -O /dev/null --post-data "username=$USERNAME&password=$PASSWORD" ''
			if [ "$ACCOUNTTYPE" = "2" ]
			wget --no-check-certificate -T 2 -O /dev/null --post-data "username=$USERNAME&password=$PASSWORD" ''
				if [ "$ACCOUNTTYPE" = "3" ]
				wget --no-check-certificate -T 2 -O /dev/null --post-data "username=$USERNAME&password=$PASSWORD" ''
					clear ; echo 'Online'
    clear ; echo 'Online'
sleep 1

cat /etc/rc.local

ive tried but it woudnt trigger (Tried adding via LUCI /system/startup)

My Last Attempt

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.


exit 0

  1. Use logger -t debug_my_code my_message instead of echo
  2. Use absolute paths instead of relative.

That looks wrong. Shouldn't that be just /sbin/ ?

This Any Help? (Rather New To All This)

root@LEDE:/sbin# find "$(cd ..; pwd)" -name ""

This Seemed To Work but tried many similar configs and wouldn't trigger

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.


exit 0

The /sbin/ is enough.

That Works, No Idea What I Did Wrong Originally,

Odd Note, With The Script Running My Power LED doesn't Stop Flashing & reboot from LUCI no longer works either,

Any Ideas?

Since it is not backgrounding it does not allow the boot process to fully complete. Try adding an & after the command:

/sbin/ &

1 Like

Im Afraid The $ Made No Difference

It's a &, not a $

1 Like

sorry been looking at symbols all day haha

This Causes The Script To No Longer Run At All

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

/sbin/ &

exit 0

Keep in mind that anything that runs as a startup script will be run headless, so the echo commands won't work properly -- you may want to replace those with logger commands.


Is this running on 17.01? And if so, is this running the official LEDE release or is it a vendor customized version? If the latter, that may change how some of this stuff works.

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:

ubus call system board

All Should Be Official, i also have x2 bt home hub 5a and TP-Link WR2543ND Both Running 19.07.9, just using This D-Link To Test With, Its On 17.x as 19.x wouldn't save config after reboot (low storage device)


root@LEDE:~# ubus call system board
        "kernel": "4.4.182",
        "hostname": "LEDE",
        "system": "Ralink RT3052 id:1 rev:3",
        "model": "D-Link DIR-615 D",
        "board_name": "dir-615-d",
        "release": {
                "distribution": "LEDE",
                "version": "17.01.7",
                "revision": "r4030-6028f00df0",
                "codename": "reboot",
                "target": "ramips\/rt305x",
                "description": "LEDE Reboot 17.01.7 r4030-6028f00df0"

It would be wise to use a newer device with the ability to run a modern version of OpenWrt. LEDE has been EOL for many years now, and is unsupported and has many actively exploited/exploitable vulnerabilities, and really shouldn't be used on the internet anymore.

While we're talking about that... 19.07.10 was just released and that is the final release of the 19.07 series releases and it is officially EOL. It is no longer supported in terms of updates/bug-fixes/security patches (although obviously forum support continues). Consider upgrading your other devices to 21.02 if possible.

I'm sure people here will still give you a best-effort attempt to help resolve your issue, but given the age of LEDE as an OS, it is possible there are nuances that people will not remember.


Will Update One Hub 5a (128/218) to 19.10 & The Other To 20.03, i did try both (i think) 20.01 & 20.02 And they resulted in lower wifi performance, i think the tp link will be stuck on 19.x, not sure if i tried 20.x, think maybe decided to roll back too on there (8/64 device) , Yhe the dlink i bought in 2014, came with DDWRT with a 2013 build on it, used that for a few years, Will see on newer openwrt & see :slight_smile:

Infinite loop in the script.
Thee boot script should do something then end.
For example start another script in the background

so results with testing, 20.x on TP Link, 10 Mbps Slower Download Throughput vs 19.x, simmilar with BT Hubs But Not As Bad, Will Have To Try 19 again on d-link but not hopeful here, ill probably stick with 19.10 for now :slight_smile:

Something Like This?


echo "This script is about to run another script."
sh /sbin/
echo "This script has just run another script."

Add an & to this line

Like this

sh /sbin/ &

1 Like