I'm attempting to get my external IP as a variable (myextip) using curl in a bash script called extip.sh, however I can't quite work out the syntax. I have read a few examples and my best guess to make it work is below. But when I run it it returns:
extip.sh: 5: pcstatus.sh: -s: not found
Code:
#!/bin/bash
myextip= $(curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
Can you please help me find the correct syntax?
Many thanks
Tim