Skip to content

Instructions on how to set up a script to send an email with your IP in Ubuntu

Notifications You must be signed in to change notification settings

esdandreu/send-email-with-ip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

send-email-with-ip

Instructions on how to set up a script to send an email with your IP in Ubuntu

  1. Move to the folder where we will set the scripts

    cd /usr/local/bin
    
  2. Install the necessary tools

    sudo apt-get update
    sudo apt-get install sendemail
    
  3. Download the code from github

    sudo git clone https://github.com/esdandreu/send-email-with-ip.git
    
  4. Navigate to the repository

    cd /usr/local/bin/send-email-with-ip/
    
  5. Make the main script executable

    sudo chmod a+xrw send-email-with-ip.sh
    
  6. Create the .env file with your data: Open the file with your favourite editor. In my case it is neovim which can be installed with sudo apt install neovim and then run sudo vim .env to open it the file. Once you are editing .env, write:

    export EMAIL="[email protected]"
    export PASSWORD="password"
    export TO="[email protected]"
    

    Make sure that the EMAIL you wrote allows less secure apps.

  7. Modify the cronjobs

    crontab -e
    

    Choose an editor in the command line and add a line with:

    @reboot sleep 60; /usr/local/bin/send-email-with-ip/send-email-with-ip.sh
    

Now everything is set up. Reboot and check!

About

Instructions on how to set up a script to send an email with your IP in Ubuntu

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages