diff options
author | Luke Smith <luke@lukesmith.xyz> | 2025-03-04 19:03:35 +0100 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2025-03-04 19:03:35 +0100 |
commit | cfc06f891d54250c6025eda301ce4c5cac220255 (patch) | |
tree | 455e3e7780f663cb046abd140be40d533eab3ab2 /bin | |
parent | 31589ada9260c83b4229a48e1d547e681d71e097 (diff) |
more robust mbsync check, close #956
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mw | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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" \ |