-2

I am really struggling to find the solution to this problem. I would really appreciate It if you guys could put the script in nano.

dessert
  • 39,982

1 Answers1

1

If you meant to get the public IP address, you only need this command curl ipinfo.io/ip
But if you want to use a shell script, follow these steps:

  • run this command in the terminal nano script.sh
  • put these lines in your script:

    #!/bin/bash
    curl ipinfo.io/ip
    
  • press Ctrl + x , then y to save the changes.

  • run chmod +x script.sh to make your script executable

To run the script use:

./script.sh
singrium
  • 6,880