Browse Source

Merge pull request #11471 from fantom-x/syncthing

syncthing: enable/disable via config, lower priority, cleanup
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
0afea2e06b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions
  1. +1
    -1
      utils/syncthing/Makefile
  2. +6
    -2
      utils/syncthing/files/etc/config/syncthing
  3. +13
    -2
      utils/syncthing/files/etc/init.d/syncthing

+ 1
- 1
utils/syncthing/Makefile View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=syncthing
PKG_VERSION:=1.3.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=syncthing-source-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/syncthing/syncthing/releases/download/v$(PKG_VERSION)


+ 6
- 2
utils/syncthing/files/etc/config/syncthing View File

@ -1,3 +1,7 @@
config syncthing 'syncthing'
option gui_address 'http://127.0.0.1:8384'
option home '/etc/syncthing/'
option enabled '0'
option gui_address 'http://127.0.0.1:8384'
option home '/etc/syncthing/'

+ 13
- 2
utils/syncthing/files/etc/init.d/syncthing View File

@ -1,14 +1,24 @@
#!/bin/sh /etc/rc.common
START=99
START=90
STOP=10
USE_PROCD=1
NICEPRIO=19
PROG=/usr/bin/syncthing
start_service() {
[ -d /var/syncthing/ ] || mkdir /var/syncthing/
local gui_address home
local gui_address home enabled
config_load "syncthing"
# The first version had the service enabled by default,
# so preserving the old behaviour
config_get_bool enabled syncthing enabled 1
[ "$enabled" -gt 0 ] || return 0
config_get gui_address syncthing gui_address "http://127.0.0.1:8384"
config_get home syncthing home "/etc/syncthing/"
@ -17,5 +27,6 @@ start_service() {
procd_append_param command -gui-address="$gui_address"
procd_append_param command -home="$home"
procd_set_param respawn
procd_set_param nice "$NICEPRIO"
procd_close_instance
}

Loading…
Cancel
Save