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
8902b560
Commit
8902b560
authored
Dec 28, 2015
by
Neil
Browse files
Merge pull request #10 from Neilpang/dev
polish install/uninstall messages.
parents
40a82b40
ae5f79d8
Changes
1
Show whitespace changes
Inline
Side-by-side
le.sh
View file @
8902b560
...
...
@@ -512,28 +512,28 @@ renewAll() {
install
()
{
_initpath
if
!
command
-v
"curl"
;
then
_
info
"Please install curl first."
_
info
"Ubuntu: sudo apt-get install curl"
_
info
"CentOS: yum install curl"
if
!
command
-v
"curl"
>
/dev/null
;
then
_
err
"Please install curl first."
_
err
"Ubuntu: sudo apt-get install curl"
_
err
"CentOS: yum install curl"
return
1
fi
if
!
command
-v
"crontab"
;
then
_
info
"Please install crontab first."
_
info
"CentOs: yum -y install crontabs"
if
!
command
-v
"crontab"
>
/dev/null
;
then
_
err
"Please install crontab first."
_
err
"CentOs: yum -y install crontabs"
return
1
fi
if
!
command
-v
"openssl"
;
then
_
info
"Please install openssl first."
_
info
"CentOs: yum -y install openssl"
if
!
command
-v
"openssl"
>
/dev/null
;
then
_
err
"Please install openssl first."
_
err
"CentOs: yum -y install openssl"
return
1
fi
if
!
command
-v
"xxd"
;
then
_
info
"Please install xxd first."
_
info
"CentOs: yum install vim-common"
if
!
command
-v
"xxd"
>
/dev/null
;
then
_
err
"Please install xxd first."
_
err
"CentOs: yum install vim-common"
return
1
fi
...
...
@@ -553,10 +553,10 @@ install() {
_info
"Installing cron job"
if
!
crontab
-l
|
grep
'le.sh renewAll'
;
then
crontab
-l
|
{
cat
;
echo
"0 0 * * * le.sh renewAll"
;
}
| crontab -
if
command
-v
crond
;
then
service cron reload
if
command
-v
crond
>
/dev/null
;
then
service cron
d
reload
2>/dev/null
else
service cron re
start
service cron re
load 2>/dev/null
fi
fi
...
...
@@ -567,7 +567,15 @@ install() {
uninstall
()
{
_initpath
_info
"Removing cron job"
if
!
crontab
-l
|
grep
'le.sh renewAll'
;
then
crontab
-l
|
sed
"/le.sh renewAll/d"
| crontab -
if
command
-v
crond
>
/dev/null
;
then
service crond reload 2>/dev/null
else
service cron reload 2>/dev/null
fi
fi
_info
"Removing /bin/le.sh"
rm
-f
/bin/le
...
...
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