Skip to content

Pass arguments to installOnline function #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ or
wget -O - https://get.acme.sh | sh
```

### Install Options

See https://github.com/Neilpang/acme.sh/wiki/Options-and-Params for available options.

```
curl https://get.acme.sh | ACME_USE_WGET=1 HTTPS_INSECURE=1 sh -s -- --home /opt/acme.sh --noprofile

```

or

```
wget -O - https://get.acme.sh | HTTPS_INSECURE=1 sh -s -- --home /opt/acme.sh --noprofile
```

## 2. Advanced Installation:

https://github.com/Neilpang/acme.sh/wiki/How-to-install
Expand Down
39 changes: 32 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,44 @@
return 1
fi
if type command >/dev/null 2>&1 ; then
command -v $cmd >/dev/null 2>&1
command -v "$cmd" >/dev/null 2>&1
else
type $cmd >/dev/null 2>&1
type "$cmd" >/dev/null 2>&1
fi
ret="$?"
return $ret
return "$?"
}

if _exists curl && [ "${ACME_USE_WGET:-0}" = "0" ]; then
curl https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh | INSTALLONLINE=1 sh
_truthy() {
val="$(echo "$1" | tr '[:upper:]' '[:lower:]')"
[ -n "$val" ] && [ "$val" != 0 ] && [ "$val" != false ]
}

if _truthy "$HTTPS_INSECURE"; then
_CURL_OPTS="--insecure"
_WGET_OPTS="--no-check-certificate"
else
_CURL_OPTS=
_WGET_OPTS=
fi

if _truthy "$ACME_USE_WGET"; then
_USE_WGET=1
else
_USE_WGET=0
fi

_ACME="https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh"
_CURL="curl $_CURL_OPTS $_ACME"
_WGET="wget $_WGET_OPTS -O - $_ACME"

if _exists curl && [ -z "$_USE_WGET" ]; then
_CMND="$_CURL"
elif _exists wget ; then
wget -O - https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh | INSTALLONLINE=1 sh
_CMND="$_WGET"
else
echo "Sorry, you must have curl or wget installed first."
echo "Please install either of them and try again."
exit 2
fi

$_CMND | ACME_USE_WGET=$_USE_WGET INSTALLONLINE=1 sh -s -- "$@"