mirror of https://github.com/vitalif/grive2
Can enable services systemd excaped
parent
94bda77b1b
commit
d698d596d9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue