How to make a .sh file autorun at boot

Hi everyone:

My PR4100 always receives “New firmware available”,but I want to stay at OS3.
So I write these scripts in a .sh file

[ -f /tmp/fw_upgrade_info ] && rm -f /tmp/fw_upgrade_info

[ -f /tmp/fw_upgrade_filesize ] && rm -f /tmp/fw_upgrade_filesize

[ -f /tmp/flash_update_firmware ] && rm -f /tmp/flash_update_firmware

[ -f /tmp/flash_update_firmware ] && rm -f /tmp/flash_update_firmware

[ -f /tmp/upgrade_count ] && rm -f /tmp/upgrade_count

clearAlerts.sh 1011

These scripts would remove new firmware alert,but I don’t know how to make it autorun at system boot.

Appreciate for your help

OK! Problem perfectly solved like this:

  1. Install Entware 1.05(downloaded from WDCommunity)
  2. Save the scripts you want to autorun at system boot to a file named such as your_autorun_scripts.sh
  3. Login mycloud with Winscp
  4. Copy your_autorun_scripts.sh to /mnt/HD/HD_a2/entware/etc/init.d directory using winscp

then your_autorun_scripts.sh would be executed at system boot

1 Like

Thanks for sharing. I found that the file naming matters if you want your script to be activated. You need to pre-pend Sxx where XX can be any two digits e.g. S99myscript. See more details here