From 7ee52196362d67b2da95baa345b85a34ce149379 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 23 Apr 2018 08:30:30 +0200 Subject: bin/checkip: Making this a sh script. Checking for availability of dig on the system. Always exiting with exit code 0. --- bin/checkip | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3-70-g09d2