Init: first commit
This commit is contained in:
parent
5f8cc15838
commit
8f5bbe1d6f
6 changed files with 76 additions and 0 deletions
26
stop.sh
Executable file
26
stop.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
# Stop rslsync process
|
||||
|
||||
# Check pid file exists
|
||||
if [ ! -f ./storage/sync.pid ]; then
|
||||
echo "./storage/sync.pid file not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get pid from ./storage/sync.pid
|
||||
pid=$(cat ./storage/sync.pid)
|
||||
|
||||
# Echo
|
||||
echo "stopping rslsync process (pid: $pid)"
|
||||
|
||||
# Send SIGTERM to the process and wait for it to exit
|
||||
kill -SIGTERM $pid
|
||||
while kill -0 $pid 2> /dev/null; do # PID가 존재하는 동안 대기합니다.
|
||||
sleep 1 # 1초마다 체크합니다.
|
||||
done
|
||||
|
||||
# Remove the pid file if exists
|
||||
#rm -f ./storage/sync.pid
|
||||
|
||||
# Echo
|
||||
echo "rslsync process stopped"
|
||||
Loading…
Add table
Add a link
Reference in a new issue