Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
48a8e6e6
Commit
48a8e6e6
authored
Mar 08, 2016
by
neil
Browse files
minor, just more checks
parent
f8029e2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
le.sh
View file @
48a8e6e6
...
@@ -296,6 +296,7 @@ _setopt() {
...
@@ -296,6 +296,7 @@ _setopt() {
else
else
_debug APP
_debug APP
echo
""
>>
"
$__conf
"
echo
"
$__opt$__sep$__val$__end
"
>>
"
$__conf
"
echo
"
$__opt$__sep$__val$__end
"
>>
"
$__conf
"
fi
fi
_debug
"
$(
grep
-H
-n
"^
$__opt$__sep
"
$__conf
)
"
_debug
"
$(
grep
-H
-n
"^
$__opt$__sep
"
$__conf
)
"
...
@@ -376,7 +377,10 @@ _initpath() {
...
@@ -376,7 +377,10 @@ _initpath() {
fi
fi
domain
=
"
$1
"
domain
=
"
$1
"
mkdir
-p
"
$LE_WORKING_DIR
"
if
!
mkdir
-p
"
$LE_WORKING_DIR
"
;
then
_err
"Can not craete working dir:
$LE_WORKING_DIR
"
return
1
fi
if
[
-z
"
$ACCOUNT_KEY_PATH
"
]
;
then
if
[
-z
"
$ACCOUNT_KEY_PATH
"
]
;
then
ACCOUNT_KEY_PATH
=
"
$LE_WORKING_DIR
/account.key"
ACCOUNT_KEY_PATH
=
"
$LE_WORKING_DIR
/account.key"
...
@@ -1071,7 +1075,12 @@ installcronjob() {
...
@@ -1071,7 +1075,12 @@ installcronjob() {
fi
fi
crontab
-l
|
{
cat
;
echo
"0 0 * * * LE_WORKING_DIR=
\"
$LE_WORKING_DIR
\"
$lesh
cron > /dev/null"
;
}
| crontab -
crontab
-l
|
{
cat
;
echo
"0 0 * * * LE_WORKING_DIR=
\"
$LE_WORKING_DIR
\"
$lesh
cron > /dev/null"
;
}
| crontab -
fi
fi
return
0
if
[
"
$?
"
!=
"0"
]
;
then
_err
"Install cron job failed. You need to manually renew your certs."
_err
"Or you can add cronjob by yourself:"
_err
"LE_WORKING_DIR=
\"
$LE_WORKING_DIR
\"
$lesh
cron > /dev/null"
return
1
fi
}
}
uninstallcronjob
()
{
uninstallcronjob
()
{
...
@@ -1163,7 +1172,10 @@ _initconf() {
...
@@ -1163,7 +1172,10 @@ _initconf() {
}
}
install
()
{
install
()
{
_initpath
if
!
_initpath
;
then
_err
"Install failed."
return
1
fi
#check if there is sudo installed, AND if the current user is a sudoer.
#check if there is sudo installed, AND if the current user is a sudoer.
if
command
-v
sudo
>
/dev/null
;
then
if
command
-v
sudo
>
/dev/null
;
then
...
@@ -1203,9 +1215,14 @@ install() {
...
@@ -1203,9 +1215,14 @@ install() {
_info
"Installing to
$LE_WORKING_DIR
"
_info
"Installing to
$LE_WORKING_DIR
"
_info
"Installed to
$LE_WORKING_DIR
/le.sh"
cp
le.sh
"
$LE_WORKING_DIR
/"
&&
chmod
+x
"
$LE_WORKING_DIR
/le.sh"
cp
le.sh
$LE_WORKING_DIR
/
chmod
+x
$LE_WORKING_DIR
/le.sh
if
[
"
$?
"
!=
"0"
]
;
then
_err
"Install failed, can not copy le.sh"
return
1
fi
_info
"Installed to
$LE_WORKING_DIR
/le.sh"
_profile
=
"
$(
_detect_profile
)
"
_profile
=
"
$(
_detect_profile
)
"
if
[
"
$_profile
"
]
;
then
if
[
"
$_profile
"
]
;
then
...
...
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