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
f9a1b641
Commit
f9a1b641
authored
Feb 19, 2016
by
neil
Browse files
remove sudo from crontab
parent
18d10a9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
le.sh
View file @
f9a1b641
#!/bin/bash
#!/bin/bash
VER
=
1.1.
6
VER
=
1.1.
7
PROJECT
=
"https://github.com/Neilpang/le"
PROJECT
=
"https://github.com/Neilpang/le"
DEFAULT_CA
=
"https://acme-v01.api.letsencrypt.org"
DEFAULT_CA
=
"https://acme-v01.api.letsencrypt.org"
...
@@ -322,13 +322,6 @@ _stopserver() {
...
@@ -322,13 +322,6 @@ _stopserver() {
_initpath
()
{
_initpath
()
{
#check if there is sudo installed, AND if the current user is a sudoer.
if
command
-v
sudo
>
/dev/null
;
then
if
[
"
$(
sudo
-n
uptime
2>&1|grep
"load"
|wc
-l
)
"
!=
"0"
]
;
then
SUDO
=
sudo
fi
fi
if
[
-z
"
$LE_WORKING_DIR
"
]
;
then
if
[
-z
"
$LE_WORKING_DIR
"
]
;
then
LE_WORKING_DIR
=
$HOME
/.le
LE_WORKING_DIR
=
$HOME
/.le
fi
fi
...
@@ -1043,7 +1036,7 @@ installcronjob() {
...
@@ -1043,7 +1036,7 @@ installcronjob() {
_err
"Can not install cronjob, le.sh not found."
_err
"Can not install cronjob, le.sh not found."
return
1
return
1
fi
fi
crontab
-l
|
{
cat
;
echo
"0 0 * * *
$SUDO
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
return
0
}
}
...
@@ -1138,7 +1131,14 @@ _initconf() {
...
@@ -1138,7 +1131,14 @@ _initconf() {
install
()
{
install
()
{
_initpath
_initpath
#check if there is sudo installed, AND if the current user is a sudoer.
if
command
-v
sudo
>
/dev/null
;
then
if
[
"
$(
sudo
-n
uptime
2>&1|grep
"load"
|wc
-l
)
"
!=
"0"
]
;
then
SUDO
=
sudo
fi
fi
if
command
-v
yum
>
/dev/null
;
then
if
command
-v
yum
>
/dev/null
;
then
YUM
=
"1"
YUM
=
"1"
INSTALL
=
"
$SUDO
yum install -y "
INSTALL
=
"
$SUDO
yum install -y "
...
...
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