Skip to content

Commit cfc06f8

Browse files
committed
more robust mbsync check, close #956
1 parent 31589ad commit cfc06f8

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎bin/mw‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -a
44

@@ -31,14 +31,15 @@ maxmes="0"
3131

3232
alias mbsync='mbsync -c "$mbsyncrc"'
3333

34-
# mbsync now requires "Far/Near" rather than "Master/Slave", but Ubuntu/Debian
35-
# have the older version.
36-
if command -V apt-get >/dev/null 2>&1; then
37-
master="Master"
38-
slave="Slave"
39-
else
34+
# mbsync >=1.4.0 requires "Far/Near" rather than "Master/Slave."
35+
mbver="$(mbsync -v)"
36+
mbver="${mbver#* }"
37+
if [ "${mbver%.*}" >= 1.4 ]; then
4038
master="Far"
4139
slave="Near"
40+
else
41+
master="Master"
42+
slave="Slave"
4243
fi
4344

4445
for x in "/etc/ssl/certs/ca-certificates.crt" \

0 commit comments

Comments
 (0)