From 33ada9e96503746e8035b0ebe1b6639ce23e2226 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 29 May 2017 14:18:04 +0800 Subject: bin/mbsync_cron.sh: Remove check_server(), update usage --- bin/mbsync_cron.sh | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'bin') 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} " + 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 -- cgit v1.2.2