mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-11-13 08:36:28 +00:00
f62c1f3cc2
Add manpage on the way
24 lines
407 B
Bash
Executable File
24 lines
407 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
WORKTARGET=$(mktemp -d)
|
|
PIDFILE=$(mktemp)
|
|
LOGFILE=$(mktemp)
|
|
|
|
./lsyncd --logfile "${LOGFILE}" --pidfile "${PIDFILE}" . "${WORKTARGET}"
|
|
sleep 1s
|
|
LSYNCPID=$(cat "${PIDFILE}")
|
|
if ! kill "${LSYNCPID}"; then
|
|
echo "kill failed"
|
|
exit 1
|
|
fi
|
|
sleep 1s
|
|
if kill "${LSYNCPID}"; then
|
|
echo process still exists after kill
|
|
exit 1
|
|
fi
|
|
rm "${PIDFILE}"
|
|
rm "${LOGFILE}"
|
|
rm -rf "${WORKTARGET}"
|
|
|