Mainboard Piezo Beep Control Chime on Startup & Shutdown

Hello OpenWRT readers.

Since this is my first post on this forum, and I'm not sure to have chosen the correct category placement, any corrections and suggestions are welcome.

I made a small script which controls the BIOS-based mainboard piezo buzzer upon startup and shutdown / reboot as follows:

# Begin Beep Script
# Created By ServerNthusiasT on April 10th, 2024
#!/bin/sh /etc/rc.common
START=15
STOP=10

boot()
{
beep -l 75 -f 1046 -n -l 75 -f 1397 -n -l 75 -f 1760 -n -l 75 -f 2093
}

stop()
{
beep -l 75 -f 2093 -n -l 75 -f 1760 -n -l 75 -f 1397 -n -l 75 -f 1046
}
# End Beep Script

This script lets the system emerge a small four-tone melody chime as the system boots up or shuts down. It's a neat lil' doodad which lets the user know wether the system is ready to operate. In other cases it is completely silent.

By default, OpenWRT's underlying operating system silently starts up and shuts down. I have seen other operating systems make use of the mainboard buzzer on their own, audibly indicating the operational status of the hardware.

Therefore I am suggesting this feature, which can easily be added at any time via command line. Note that the package "beep" is required in order to use the script.

CLI commands:

  • opkg update
  • opkg install beep
  • opkg install nano ( Optional, in case you're not familiar with "vi" )
  • nano /etc/init.d/beep
    [ Insert script above ]
    Ctrl+O to save, Ctrl+X to exit Nano.
  • chmod +x /etc/init.d/beep
  • /etc/init.d/beep enable
  • reboot ( To test the script, if you allow a momentary downtime of your machine )

I have been using this script on various BIOS-based systems for a couple of months without any porblem. Be aware that this does not work for UEFI-based systems at the point of time this post was published.

I hope you find this feature useful at any future point, and one day it might be included by OpenWRT devs.