I am using FreeBSD 9 and I want to make a script that will check if an Ethernet cable is connected, and if so, connects to it. I want to set it so that it runs whenever the machine starts up, or whenever I log in. I looked at my UNIX book (It is pretty outdated, and is for general UNIX, not specifically FreeBSD) and it says that I can use crontab, but I can only do this to make things run at certain times, not when it starts up. Can someone please tell me how I can get at this?
If you want also to run the check when you log in, add a call to the script in the file your shell executes upon login - this could be, depending on your shell,
On FreeBSD 11 for ARMv6 (Raspberry Pi), I couldn't get the crontab
In other words, to run a script on boot on FreeBSD 11 (or 10?) and likely newer, place an executable shell script with the .sh extension in this folder to have it executed on boot:
You may need to create the
See http://www.defcon1.org/html/rc-local.html for details.