update 2026-05-13 01:55:45

This commit is contained in:
action
2026-05-13 01:55:45 +08:00
parent 1b6001bfed
commit 6f4a0231c5
1857 changed files with 749084 additions and 99 deletions
+43
View File
@@ -0,0 +1,43 @@
#!/bin/sh /etc/rc.common
START=50
run_syncthing()
{
local enabled
config_get_bool enabled $1 enabled
if [ $enabled = 1 ]; then
local port
config_get port $1 port
state=`pgrep syncthing | wc -l`
if [ $state = 0 ] ; then
export HOME="/root"
syncthing -gui-address="0.0.0.0:$port" -logfile="/var/log/syncthing.log" -no-browser >/dev/null &
echo "启动中..."
start=`pgrep syncthing | wc -l`
if [ $start = 0 ] ; then
echo "启动失败"
else
echo "启动成功"
fi
else
echo "已在运行"
fi
fi
}
start()
{
config_load "luci-app-syncthing"
config_foreach run_syncthing setting
}
stop()
{
kill -9 `pgrep syncthing`
stop=`pgrep syncthing | wc -l`
if [ $stop = 0 ] ; then
echo "已停止运行"
else
echo "未停止运行"
fi
}