mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-13 03:57:52 +08:00
update 2026-05-13 01:55:45
This commit is contained in:
1 parent
1b6001bfed
commit
6f4a0231c5
1857 files changed
+749084
-99
No files matched your search
@@ -0,0 +1,4 @@
|
||||
|
||||
config setting 'config'
|
||||
option enabled '0'
|
||||
option port '8384'
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
touch /etc/config/luci-app-syncthing
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@luci-app-syncthing[-1]
|
||||
add ucitrack luci-app-syncthing
|
||||
set ucitrack.@luci-app-syncthing[-1].exec='/etc/init.d/luci-app-syncthing restart'
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
rm -rf /tmp/luci-*cache
|
||||
exit 0
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"luci-app-syncthing": {
|
||||
"description": "Grant UCI access for luci-app-syncthing",
|
||||
"read": {
|
||||
"uci": [ "luci-app-syncthing" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "luci-app-syncthing" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"config": "luci-app-syncthing",
|
||||
"init": "luci-app-syncthing"
|
||||
}
|
||||
Reference in new issue
Block a user