This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-run-script-on-startup-on-ubuntu-20-04-focal-fossa-server-desktop
I believe that you are missing an important instruction in Step 1:
First, create a Systemd service file as in an example below:
After: Instructs systemd on when the script should be run. In our case the script will run after network connection. Other example could be mysql.target etc.
ExecStart: This field provides a full path to the actual script to be executed on startup
WantedBy: Into what boot target the systemd unit should be installed
For more information on how to create Systemd service unit execute the man systemd.unit command.
Namely, you should mention that when you create the example service it should be saved as a file, e.g.,
While a close read of step 3 explains that, a novice might not understand what file to create where.
Otherwise you need to scroll to the bottom of the article, see where the file is, then scroll back up to get the contents…