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.
Asked
Active
Viewed 1,130 times
-2
-
1Please do not post the very same question twice. – PerlDuck Nov 06 '18 at 11:51
1 Answers
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