From 036e9d107483434dcb6bdc8b4701d244cfcfc8f6 Mon Sep 17 00:00:00 2001 From: neil Date: Sat, 16 Apr 2016 21:01:40 +0800 Subject: [PATCH] fix compatible for sh --- acme.sh | 4 ++-- dnsapi/dns-cf.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acme.sh b/acme.sh index 1fcee01..0cafab9 100755 --- a/acme.sh +++ b/acme.sh @@ -1982,7 +1982,7 @@ _process() { _accountemail="" _accountkey="" _certhome="" - while (( ${#} )); do + while [[ ${#} -gt 0 ]] ; do case "${1}" in --help|-h) @@ -2247,7 +2247,7 @@ fi if [[ -z "$1" ]] ; then showhelp else - if [[ "$1" == "-"* ]] ; then + if echo "$1" | grep "^-" >/dev/null 2>&1 ; then _process "$@" else "$@" diff --git a/dnsapi/dns-cf.sh b/dnsapi/dns-cf.sh index dc56bf1..b2d67c7 100755 --- a/dnsapi/dns-cf.sh +++ b/dnsapi/dns-cf.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env sh # @@ -12,7 +12,7 @@ CF_Api="https://api.cloudflare.com/client/v4/" ######## Public functions ##################### #Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" -dns-cf-add() { +dns-cf-add(){ fulldomain=$1 txtvalue=$2