aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-05-29 14:18:04 +0800
committerAaron LI <aly@aaronly.me>2017-05-29 14:18:04 +0800
commit33ada9e96503746e8035b0ebe1b6639ce23e2226 (patch)
tree5a031cd9c108f61db8bf4b7bad3e6bc9cf4173f6 /bin
parent26038b4872b4d30c306f5b3b60eb262b4c086221 (diff)
downloadatoolbox-33ada9e96503746e8035b0ebe1b6639ce23e2226.tar.bz2
bin/mbsync_cron.sh: Remove check_server(), update usage
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mbsync_cron.sh37
1 files changed, 13 insertions, 24 deletions
diff --git a/bin/mbsync_cron.sh b/bin/mbsync_cron.sh
index fd435db..ee734d6 100755
--- a/bin/mbsync_cron.sh
+++ b/bin/mbsync_cron.sh
@@ -69,6 +69,19 @@ notify() {
usage() {
error "usage: ${PROG} <account>"
+ error ""
+ error "available accounts:"
+ error " * aly"
+ error " * weitian"
+ error " * webmaster"
+ error " * autistici"
+ error " * lavabit"
+ error " * outlook-aly"
+ error " * outlook-li"
+ error " * gmail-aly"
+ error " * gmail-li"
+ error " * sjtu"
+ error " * foxmail"
}
@@ -84,42 +97,27 @@ check_cached_passphrase() {
}
-# Check the network availability and remote server online status.
-# FIXME: need test IMAP connection instead of ping the server...
-check_server() {
- local server="$1"
- ping -c 3 ${server} >/dev/null 2>&1
-}
-
-
case "$1" in
aly|weitian|webmaster)
ACCOUNT="$1"
- SERVER="mail.aaronly.me"
;;
autistici)
ACCOUNT="$1"
- SERVER="mail.autistici.org"
;;
lavabit)
ACCOUNT="$1"
- SERVER="imap.lavabit.com"
;;
outlook-aly|outlook-li)
ACCOUNT="$1"
- SERVER="imap-mail.outlook.com"
;;
gmail-aly|gmail-li)
ACCOUNT="$1"
- SERVER="imap.gmail.com"
;;
sjtu)
ACCOUNT="$1"
- SERVER="imap.sjtu.edu.cn"
;;
foxmail)
ACCOUNT="$1"
- SERVER="imap.qq.com"
;;
-h|--help)
usage
@@ -147,20 +145,11 @@ if ! check_cached_passphrase ${GPG_KEY}; then
exit 2
fi
-#if ! check_server ${SERVER}; then
-# log "Network not available or remote server ${SERVER} is offline!"
-# notify "Network not available or remote server ${SERVER} is offline!"
-# exit 3
-#fi
-
if [ -f "${PIDFILE}" ]; then
PID=$(cat ${PIDFILE})
if is_running ${PID} && ! kill ${PID} >/dev/null 2>&1; then
log "Cannot kill process: ${PID}"
notify "Cannot kill process: ${PID}"
- else
- log "Killed previous instance: ${PID}"
- notify "Killed previous instance: ${PID}"
fi
fi