From e5475b7e3e0612540816eb3cb32ebb1dd5d4f552 Mon Sep 17 00:00:00 2001 From: ahwayakchih Date: Mon, 11 Feb 2019 17:11:58 +0100 Subject: [PATCH] fix: check if `devil` command exists, as requested by @Neilpang --- deploy/mydevil.sh | 5 +++++ dnsapi/dns_mydevil.sh | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/deploy/mydevil.sh b/deploy/mydevil.sh index ef31b04b..73981abd 100755 --- a/deploy/mydevil.sh +++ b/deploy/mydevil.sh @@ -27,6 +27,11 @@ mydevil_deploy() { _debug _cca "$_cca" _debug _cfullchain "$_cfullchain" + if ! _exists "devil" ; then + _err "Could not find 'devil' command." + return 1 + fi + ip=$(mydevil_get_ip "$_cdomain") if [ -z "$ip" ]; then _err "Could not find IP for domain $_cdomain." diff --git a/dnsapi/dns_mydevil.sh b/dnsapi/dns_mydevil.sh index 8f8c5580..820233f3 100755 --- a/dnsapi/dns_mydevil.sh +++ b/dnsapi/dns_mydevil.sh @@ -18,6 +18,11 @@ dns_mydevil_add() { txtvalue=$2 domain="" + if ! _exists "devil" ; then + _err "Could not find 'devil' command." + return 1 + fi + _info "Using mydevil" domain=$(mydevil_get_domain "$fulldomain") @@ -48,6 +53,11 @@ dns_mydevil_rm() { txtvalue=$2 domain="" + if ! _exists "devil" ; then + _err "Could not find 'devil' command." + return 1 + fi + _info "Using mydevil" domain=$(mydevil_get_domain "$fulldomain")