summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw10
1 files changed, 7 insertions, 3 deletions
diff --git a/bin/mw b/bin/mw
index 5698f09..2101cdd 100755
--- a/bin/mw
+++ b/bin/mw
@@ -34,7 +34,11 @@ alias mbsync='mbsync -c "$mbsyncrc"'
# mbsync >=1.4.0 requires "Far/Near" rather than "Master/Slave."
mbver="$(mbsync -v)"
mbver="${mbver#* }"
-if [ "${mbver%.*}" >= 1.4 ]; then
+mbver="${mbver%.*}"
+# Comparing two float numbers in bash is a pain in the butt, so we get rid of
+# dots and turn them into nice integers
+mbver="${mbver/\./}"
+if [ "${mbver}" -gt 14 ]; then
master="Far"
slave="Near"
else
@@ -82,7 +86,7 @@ prepmpop() {
}
prepimapnotify() {
- mkdir -p "${imapnotify%/*}" ; envsubst < "$imapnotifytemp" >> "$imapnotify/$fulladdr.conf"
+ mkdir -p "$imapnotify" ; envsubst < "$imapnotifytemp" >> "$imapnotify/$fulladdr.conf"
}
prepmutt() {
@@ -190,7 +194,7 @@ askinfo() {
}
insertpass() {
- printf "%s" "$password" | pass insert -fe "$PASSWORD_STORE_DIR/$passprefix$fulladdr"
+ printf "%s" "$password" | pass insert -fe "$passprefix$fulladdr"
}
errorexit() {