Commit 8902b560 authored by Neil's avatar Neil
Browse files

Merge pull request #10 from Neilpang/dev

polish install/uninstall messages.
parents 40a82b40 ae5f79d8
...@@ -512,28 +512,28 @@ renewAll() { ...@@ -512,28 +512,28 @@ renewAll() {
install() { install() {
_initpath _initpath
if ! command -v "curl" ; then if ! command -v "curl" > /dev/null ; then
_info "Please install curl first." _err "Please install curl first."
_info "Ubuntu: sudo apt-get install curl" _err "Ubuntu: sudo apt-get install curl"
_info "CentOS: yum install curl" _err "CentOS: yum install curl"
return 1 return 1
fi fi
if ! command -v "crontab" ; then if ! command -v "crontab" > /dev/null ; then
_info "Please install crontab first." _err "Please install crontab first."
_info "CentOs: yum -y install crontabs" _err "CentOs: yum -y install crontabs"
return 1 return 1
fi fi
if ! command -v "openssl" ; then if ! command -v "openssl" > /dev/null ; then
_info "Please install openssl first." _err "Please install openssl first."
_info "CentOs: yum -y install openssl" _err "CentOs: yum -y install openssl"
return 1 return 1
fi fi
if ! command -v "xxd" ; then if ! command -v "xxd" > /dev/null ; then
_info "Please install xxd first." _err "Please install xxd first."
_info "CentOs: yum install vim-common" _err "CentOs: yum install vim-common"
return 1 return 1
fi fi
...@@ -553,10 +553,10 @@ install() { ...@@ -553,10 +553,10 @@ install() {
_info "Installing cron job" _info "Installing cron job"
if ! crontab -l | grep 'le.sh renewAll' ; then if ! crontab -l | grep 'le.sh renewAll' ; then
crontab -l | { cat; echo "0 0 * * * le.sh renewAll"; } | crontab - crontab -l | { cat; echo "0 0 * * * le.sh renewAll"; } | crontab -
if command -v crond ; then if command -v crond > /dev/null ; then
service cron reload service crond reload 2>/dev/null
else else
service cron restart service cron reload 2>/dev/null
fi fi
fi fi
...@@ -567,7 +567,15 @@ install() { ...@@ -567,7 +567,15 @@ install() {
uninstall() { uninstall() {
_initpath _initpath
_info "Removing cron job" _info "Removing cron job"
if ! crontab -l | grep 'le.sh renewAll' ; then
crontab -l | sed "/le.sh renewAll/d" | crontab - 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" _info "Removing /bin/le.sh"
rm -f /bin/le rm -f /bin/le
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment