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

  • melroy@kbin.melroy.org
    link
    fedilink
    arrow-up
    5
    ·
    11 hours ago

    Yes you right it runs everything you open a shell. bashrc only loads for non-login shells. But I would recommend adding:

    case $- in
        *i*) ;;
          *) return;;
    esac
    

    Which will stop executing bashrc further when its not running interactively.