summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Reeves <darthwayne@hotmail.com>2019-11-08 19:01:41 -0600
committerLuke Smith <luke@lukesmith.xyz>2019-11-08 20:01:41 -0500
commitff57bd2eb785ea393fd569751c47b93339af7861 (patch)
tree3690a8aeccbbdff3130e2f0aa6b215173826c5d0
parenta92c01e13121f42b9f9b8962ae2c07b0a0ce5d4d (diff)
Fix Malformed UTF-8 Character in Mailsync fixes #322 (#323)
* line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line * change the pgrep line * Revert "Update domains.csv (#321)" This reverts commit a92c01e13121f42b9f9b8962ae2c07b0a0ce5d4d. * Revert "Revert "Update domains.csv (#321)"" This reverts commit af0c0826b9a699780256dc8492e74a157cab2a85. * Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line" This reverts commit ca64a6ae56a31ead28cc638d8d8dac7e28f9df68. * Revert "Revert "line 5 defined the variable DBUS_SESSION_BUS_ADDRESS before exporting it in the next line"" This reverts commit 4304eb731c109289251e06ef86377d372cef07e4.
-rwxr-xr-xbin/mailsync5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/mailsync b/bin/mailsync
index d79507d..c56ccb2 100755
--- a/bin/mailsync
+++ b/bin/mailsync
@@ -2,12 +2,13 @@
# Sync mail and give notification if there is new mail.
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
+DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
+export DBUS_SESSION_BUS_ADDRESS
export DISPLAY=:0.0
[ -d "$HOME/.local/share/password-store" ] && export PASSWORD_STORE_DIR="$HOME/.local/share/password-store"
# Run only if user logged in (prevent cron errors)
-pgrep -u "$USER" >/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
pgrep -x mbsync >/dev/null && { echo "mbsync is already running." ; exit ;}