Skip to content

Commit

Permalink
fix compatible for sh
Browse files Browse the repository at this point in the history
  • Loading branch information
neil committed Apr 16, 2016
1 parent 5e3c015 commit e75b99c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions get.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
#!/usr/bin/env bash

_exists() {
cmd="$1"
if [[ -z "$cmd" ]] ; then
_err "Usage: _exists cmd"
return 1
fi
if type command >/dev/null 2>&1 ; then
command -v $cmd >/dev/null 2>&1
else
type $cmd >/dev/null 2>&1
fi
ret="$?"
_debug2 "$cmd exists=$ret"
return $ret
}

if command -v curl >/dev/null 2>&1 ; then
if _exists curl ; then
curl https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh | INSTALLONLINE=1 bash
elif command -v wget >/dev/null 2>&1 ; then
elif _exists wget ; then
wget -O - https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh | INSTALLONLINE=1 bash
else
echo "Sorry, you must have curl or wget installed first."
Expand Down

0 comments on commit e75b99c

Please sign in to comment.