Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
eccec5f6
Commit
eccec5f6
authored
Apr 16, 2016
by
neil
Browse files
fix compatible for sh. '-' is not allowed in function name.
parent
dceb3aca
Changes
5
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
eccec5f6
...
@@ -956,8 +956,19 @@ issue() {
...
@@ -956,8 +956,19 @@ issue() {
Le_ReloadCmd
=
"
$8
"
Le_ReloadCmd
=
"
$8
"
Le_RealFullChainPath
=
"
$9
"
Le_RealFullChainPath
=
"
$9
"
_initpath
$Le_Domain
#remove these later.
if
[[
"
$Le_Webroot
"
==
"dns-cf"
]]
;
then
Le_Webroot
=
"dns_cf"
fi
if
[[
"
$Le_Webroot
"
==
"dns-dp"
]]
;
then
Le_Webroot
=
"dns_dp"
fi
if
[[
"
$Le_Webroot
"
==
"dns-cx"
]]
;
then
Le_Webroot
=
"dns_cx"
fi
_initpath
$Le_Domain
if
[[
-f
"
$DOMAIN_CONF
"
]]
;
then
if
[[
-f
"
$DOMAIN_CONF
"
]]
;
then
Le_NextRenewTime
=
$(
grep
"^Le_NextRenewTime="
"
$DOMAIN_CONF
"
|
cut
-d
'='
-f
2
)
Le_NextRenewTime
=
$(
grep
"^Le_NextRenewTime="
"
$DOMAIN_CONF
"
|
cut
-d
'='
-f
2
)
if
[[
-z
"
$FORCE
"
]]
&&
[[
"
$Le_NextRenewTime
"
]]
&&
[[
"
$(
date
-u
"+%s"
)
"
-lt
"
$Le_NextRenewTime
"
]]
;
then
if
[[
-z
"
$FORCE
"
]]
&&
[[
"
$Le_NextRenewTime
"
]]
&&
[[
"
$(
date
-u
"+%s"
)
"
-lt
"
$Le_NextRenewTime
"
]]
;
then
...
@@ -1189,7 +1200,7 @@ issue() {
...
@@ -1189,7 +1200,7 @@ issue() {
return
1
return
1
fi
fi
addcommand
=
"
$_currentRoot
-
add"
addcommand
=
"
$_currentRoot
_
add
"
if
!
_exists
$addcommand
;
then
if
!
_exists
$addcommand
;
then
_err
"It seems that your api file is not correct, it must have a function named:
$addcommand
"
_err
"It seems that your api file is not correct, it must have a function named:
$addcommand
"
return
1
return
1
...
@@ -1924,7 +1935,7 @@ Parameters:
...
@@ -1924,7 +1935,7 @@ Parameters:
--webroot, -w /path/to/webroot Specifies the web root folder for web root mode.
--webroot, -w /path/to/webroot Specifies the web root folder for web root mode.
--standalone Use standalone mode.
--standalone Use standalone mode.
--apache Use apache mode.
--apache Use apache mode.
--dns [dns
-
cf|dns
-
dp|dns
-
cx|/path/to/api/file] Use dns mode or dns api.
--dns [dns
_
cf|dns
_
dp|dns
_
cx|/path/to/api/file] Use dns mode or dns api.
--keylength, -k [2048] Specifies the domain key length: 2048, 3072, 4096, 8192 or ec-256, ec-384.
--keylength, -k [2048] Specifies the domain key length: 2048, 3072, 4096, 8192 or ec-256, ec-384.
--accountkeylength, -ak [2048] Specifies the account key length.
--accountkeylength, -ak [2048] Specifies the account key length.
...
...
dnsapi/dns-cf.sh
View file @
eccec5f6
...
@@ -12,7 +12,7 @@ CF_Api="https://api.cloudflare.com/client/v4/"
...
@@ -12,7 +12,7 @@ CF_Api="https://api.cloudflare.com/client/v4/"
######## Public functions #####################
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns
-
cf
-
add
(){
dns
_
cf
_
add
(){
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
...
dnsapi/dns-cx.sh
View file @
eccec5f6
...
@@ -14,7 +14,7 @@ CX_Api="https://www.cloudxns.net/api2"
...
@@ -14,7 +14,7 @@ CX_Api="https://www.cloudxns.net/api2"
######## Public functions #####################
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns
-
cx
-
add
()
{
dns
_
cx
_
add
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
...
dnsapi/dns-dp.sh
View file @
eccec5f6
...
@@ -14,7 +14,7 @@ DP_Api="https://dnsapi.cn"
...
@@ -14,7 +14,7 @@ DP_Api="https://dnsapi.cn"
######## Public functions #####################
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns
-
dp
-
add
()
{
dns
_
dp
_
add
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
...
...
dnsapi/dns-myapi.sh
View file @
eccec5f6
#!/bin/bash
#!/bin/bash
#Here is a sample custom api script.
#Here is a sample custom api script.
#This file name is "dns
-
myapi.sh"
#This file name is "dns
_
myapi.sh"
#So, here must be a method dns
-
myapi-add()
#So, here must be a method dns
_
myapi-add()
#Which will be called by acme.sh to add the txt record to your api system.
#Which will be called by acme.sh to add the txt record to your api system.
#returns 0 meanst success, otherwise error.
#returns 0 meanst success, otherwise error.
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
######## Public functions #####################
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
dns
-
myapi
-
add
()
{
dns
_
myapi
_
add
()
{
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
_err
"Not implemented!"
_err
"Not implemented!"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment