소스 검색

compatibility: replace pidof with pgrep, set GPG_TTY to $(tty)

pull/744/head
Yifei Zhan 2 년 전
부모
커밋
28b54d9a88
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -2
      bin/mailsync

+ 2
- 2
bin/mailsync 파일 보기

@@ -14,7 +14,7 @@
# Run only if user logged in (prevent cron errors) # Run only if user logged in (prevent cron errors)
pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;} pgrep -u "${USER:=$LOGNAME}" >/dev/null || { echo "$USER not logged in; sync will not run."; exit ;}
# Run only if not already running in other instance # Run only if not already running in other instance
pidof mbsync >/dev/null && { echo "mbsync is already running."; exit ;}
pgrep mbsync >/dev/null && { echo "mbsync is already running."; exit ;}


# First, we have to get the right variables for the mbsync file, the pass # First, we have to get the right variables for the mbsync file, the pass
# archive, notmuch and the GPG home. This is done by searching common profile # archive, notmuch and the GPG home. This is done by searching common profile
@@ -25,7 +25,7 @@ eval "$(grep -h -- \
"$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \ "$HOME/.profile" "$HOME/.bash_profile" "$HOME/.zprofile" "$HOME/.config/zsh/.zprofile" "$HOME/.zshenv" \
"$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)" "$HOME/.bashrc" "$HOME/.zshrc" "$HOME/.config/zsh/.zshrc" "$HOME/.pam_environment" 2>/dev/null)"


export GPG_TTY=$TTY
export GPG_TTY="$(tty)"


[ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc" [ -n "$MBSYNCRC" ] && alias mbsync="mbsync -c $MBSYNCRC" || MBSYNCRC="$HOME/.mbsyncrc"




불러오는 중...
취소
저장