I just realized that you can run a command at login by appending it to your .bashrc
For instance, I added a curl pointing to a certain address that immediately upon login returns a message that tells me whether I’m connected to my VPN provider or not.
Sorry for the beginner revelation. Just thought it was cool. :3


That’s a neat trick. Easy to forget if you’re connected or not sometimes.
I wanted to add a little detail since it’s easy to misunderstand “upon login” as “only at login”. Actually,
.bashrcruns every time you start a new interactive non-login shell, not just on login. For your use case it doesn’t matter, but it may surprise someone if multiple copies of a program starts running as a result of adding it to .bashrc.I have quoted the bash man page below:
Thanks for the deets! :D
Right, if the program doesn’t terminate/close automatically, or if it’s one that runs over a longer period of time, then you might unknowingly and unnecessarily start several threads of it, whenever you spawn an interactive shell that is not a login shell.