Can enable services systemd excaped

pull/177/head
psfloyd 2017-12-08 00:23:17 -03:00
parent 94bda77b1b
commit d698d596d9
3 changed files with 5 additions and 4 deletions

View File

@ -2,7 +2,7 @@
Description=Google drive sync (changed files)
[Service]
ExecStart=@GRIVE_SYNC_SH_BINARY@ listen "%I"
ExecStart=@GRIVE_SYNC_SH_BINARY@ listen "%i"
Type=simple
Restart=always
RestartSec=30

View File

@ -15,13 +15,13 @@ cd ~
### ARGUMENT PARSING ###
SCRIPT="${0}"
DIRECTORY=$(systemd-escape --unescape "$2")
if [[ -z "${2}" ]] || [[ ! -d "${2}" ]] ; then
if [[ -z "$DIRECTORY" ]] || [[ ! -d "$DIRECTORY" ]] ; then
echo "Need a directory name in the current users home directory as second argument. Aborting."
exit 1
fi
DIRECTORY="$2"
if [[ -z "${1}" ]] ; then
echo "Need a command as first argument. Aborting."
@ -102,6 +102,7 @@ listen_directory() {
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}"
#echo ${SCRIPT} "${_directory}"
done
# always exit ok, so that we never go into a wrong systemd state

View File

@ -3,4 +3,4 @@ Description=Google drive sync
After=network-online.target
[Service]
ExecStart=@GRIVE_SYNC_SH_BINARY@ sync "%I"
ExecStart=@GRIVE_SYNC_SH_BINARY@ sync "%i"