How to run a script at boot? Tested on Fedora, CentOS and Raspbian.
You can use cron via
But, as far as I can see, if you need the network, it seems that this way is not suitable. Then, instead, you can use oneshot type in a systemd service.
Let’s create a systemd service file:
Then create the script.
Set it as executable.
chmod 700 /usr/local/bin/bootbotto
Then enable the service and execute it immediately (with –now).
systemctl daemon-reload; systemctl enable bootbotto --now
This script will be executed at boot, once the networking service will be started. As you can see, this script will send a message on a Telegram group.