commit cfc06f891d54250c6025eda301ce4c5cac220255 parent 31589ada9260c83b4229a48e1d547e681d71e097 Author: Luke Smith <luke@lukesmith.xyz> Date: Tue, 4 Mar 2025 19:03:35 +0100 more robust mbsync check, close #956 Diffstat:
M | bin/mw | | | 15 | ++++++++------- |
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/bin/mw b/bin/mw @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -a @@ -31,14 +31,15 @@ maxmes="0" alias mbsync='mbsync -c "$mbsyncrc"' -# mbsync now requires "Far/Near" rather than "Master/Slave", but Ubuntu/Debian -# have the older version. -if command -V apt-get >/dev/null 2>&1; then - master="Master" - slave="Slave" -else +# mbsync >=1.4.0 requires "Far/Near" rather than "Master/Slave." +mbver="$(mbsync -v)" +mbver="${mbver#* }" +if [ "${mbver%.*}" >= 1.4 ]; then master="Far" slave="Near" +else + master="Master" + slave="Slave" fi for x in "/etc/ssl/certs/ca-certificates.crt" \