Init: first commit
This commit is contained in:
parent
5f8cc15838
commit
8f5bbe1d6f
6 changed files with 76 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
resilio-sync_x64.tar.gz
|
||||
rslsync
|
||||
LICENSE.TXT
|
||||
storage/
|
||||
23
force-stop.sh
Executable file
23
force-stop.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
# force 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 "force stopping rslsync process (pid: $pid)"
|
||||
|
||||
# Send SIGKILL to the process
|
||||
kill -SIGKILL $pid
|
||||
|
||||
# Remove the pid file if exists
|
||||
#rm -f ./storage/sync.pid
|
||||
|
||||
# Echo
|
||||
echo "rslsync process force stopped"
|
||||
11
setup.sh
Executable file
11
setup.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Download Resilio Sync binary from https://download-cdn.resilio.com/stable/linux-x64/resilio-sync_x64.tar.gz
|
||||
wget https://download-cdn.resilio.com/stable/linux-x64/resilio-sync_x64.tar.gz
|
||||
tar -xvf resilio-sync_x64.tar.gz
|
||||
|
||||
# Create storage directory for rslsync data
|
||||
mkdir -p ./storage
|
||||
|
||||
# Echo
|
||||
echo "Resilio Sync binary downloaded. You can start with ./start.sh"
|
||||
2
start.sh
Executable file
2
start.sh
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
./rslsync --config user_config.json
|
||||
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"
|
||||
10
user_config.json
Normal file
10
user_config.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"storage_path" : "storage",
|
||||
"pid_file" : "storage/sync.pid",
|
||||
|
||||
"webui" :
|
||||
{
|
||||
"force_https": true,
|
||||
"listen" : "127.0.0.1:8888"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue