diff options
author | David Runge <david.runge@native-instruments.de> | 2018-04-23 08:30:30 +0200 |
---|---|---|
committer | David Runge <david.runge@native-instruments.de> | 2018-04-23 08:30:30 +0200 |
commit | 7ee52196362d67b2da95baa345b85a34ce149379 (patch) | |
tree | fe24941518e9f8efe5d64a4a01653a821b80289c /bin | |
parent | 95b770f88e8a8411a2a37755add181d93a05ea3c (diff) | |
download | dotfiles-7ee52196362d67b2da95baa345b85a34ce149379.tar.gz dotfiles-7ee52196362d67b2da95baa345b85a34ce149379.tar.bz2 dotfiles-7ee52196362d67b2da95baa345b85a34ce149379.tar.xz dotfiles-7ee52196362d67b2da95baa345b85a34ce149379.zip |
bin/checkip: Making this a sh script. Checking for availability of dig on the system. Always exiting with exit code 0.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/checkip | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/checkip b/bin/checkip index 0e9d345..831ded7 100755 --- a/bin/checkip +++ b/bin/checkip @@ -1,4 +1,6 @@ -#!/bin/bash -#echo "$(curl -s http://checkip.dyndns.org | sed 's/[a-zA-Z/<> :]//g') -#wget -qO- http://ipecho.net/plain ; echo -dig +short myip.opendns.com @resolver1.opendns.com +#!/usr/bin/env sh + +if [ -x /usr/bin/dig ]; then + dig +short myip.opendns.com @resolver1.opendns.com +fi +exit 0 |