I'm a bash newbie and am having trouble writing a simple script to see whether the server that is calling the script is the one I want to execute the script. Getting the external IP is easy and there are plenty of other posts about it. I'm having trouble with the IF statement, though.
#!/bin/bash
if [ wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//' -ne '174.123.248.82' ] ; then echo "matches"; fi
What am I doing wrong? I get an error that says:
test_script.sh: line 2: [: missing `]'
sed: -e expression #3, char 4: unknown command: `.'
Thanks!