Init commit.

This commit is contained in:
redxef 2023-04-14 01:53:20 +02:00
commit fd0fedd695
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
4 changed files with 30 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
KoboRoot.tgz
src/usr/local/syncthing/syncthing

7
Makefile Normal file
View 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

View 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"

View 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 $?