From e3e18fe16aec7b5ae849275234fbd824e4c83a95 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Mon, 3 Dec 2018 21:21:49 +0100 Subject: [PATCH] Escape folder when calling sync from change listener The old version would pass in an unescaped directory, which then got unescaped by the sync call. In some cases it worked but resulted in foldername wold not matched reality (example: google-drive -> google/drive) and error out when checking if that folder exists. --- systemd/grive-sync.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/grive-sync.sh b/systemd/grive-sync.sh index 42d6ae8..bb837ba 100755 --- a/systemd/grive-sync.sh +++ b/systemd/grive-sync.sh @@ -107,7 +107,7 @@ listen_directory() { while true #run indefinitely do # Use a different call to not need to change exit into return - inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync "${_directory}" + inotifywait -q -r -e modify,attrib,close_write,move,create,delete --exclude ".grive_state|.grive" "${_directory}" > /dev/null 2>&1 && ${SCRIPT} sync $(systemd-escape "${_directory}") #echo ${SCRIPT} "${_directory}" done