Init commit.
This commit is contained in:
commit
fd0fedd695
4 changed files with 30 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
KoboRoot.tgz
|
||||||
|
src/usr/local/syncthing/syncthing
|
7
Makefile
Normal file
7
Makefile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
|
||||||
|
SRC := $(shell find src -type f | tail -n+2)
|
||||||
|
SRC_REL := $(shell cd src && find ./ -type f)
|
||||||
|
|
||||||
|
KoboRoot.tgz: $(SRC)
|
||||||
|
tar cvzf $@ -C src $(SRC_REL) --owner=0 --group=0
|
||||||
|
|
2
src/etc/udev/rules.d/99-syncthing.rules
Normal file
2
src/etc/udev/rules.d/99-syncthing.rules
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
KERNEL=="eth*", ACTION=="add", RUN+="/usr/local/syncthing/start.sh"
|
||||||
|
KERNEL=="wlan*", ACTION=="add", RUN+="/usr/local/syncthing/start.sh"
|
19
src/usr/local/syncthing/start.sh
Executable file
19
src/usr/local/syncthing/start.sh
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$SETSID" != '1' ]; then
|
||||||
|
SETSID=1 setsid "$0" "$@" &
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if pgrep syncthing; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
SYNCTHING_HOME=/mnt/onboard/.adds/syncthing
|
||||||
|
|
||||||
|
# add 127.0.0.1 to loopback device
|
||||||
|
ip addr add 127.0.0.1/32 dev lo || true
|
||||||
|
|
||||||
|
/usr/local/syncthing/syncthing serve --no-browser --no-restart --logflags=0 \
|
||||||
|
--no-default-folder --home="$SYNCTHING_HOME"
|
||||||
|
exit $?
|
Loading…
Reference in a new issue