From 4424def8057bb384991f1c83558ce4611f49471f Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 19 May 2018 13:48:47 +0200 Subject: [PATCH] Ol' termux fixes --- termux/scripts/tsu | 6 ++++++ termux/services/syncthing | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100755 termux/scripts/tsu diff --git a/termux/scripts/tsu b/termux/scripts/tsu new file mode 100755 index 0000000..e4f6ab7 --- /dev/null +++ b/termux/scripts/tsu @@ -0,0 +1,6 @@ +#!/data/data/com.termux/files/usr/bin/env bash + +# Force the passing of the environment variables on LineageOS where the --preserve-environment +# option on the su binary doesn't seem to work well + +/data/data/com.termux/files/usr/bin/tsu -s "$(env | sed "s/^\([^=]\+\)=\(.*\)/\1='\2'/" | tr '\n' ' ') $(which bash)" diff --git a/termux/services/syncthing b/termux/services/syncthing index 70bbaca..dc5cbc8 100755 --- a/termux/services/syncthing +++ b/termux/services/syncthing @@ -8,7 +8,7 @@ LOGFILE="$HOME/.local/log/syncthing.log" start() { printf "Starting Syncthing: " - sudo start-stop-daemon -p "$PIDFILE" -x syncthing -S -b -N 5 -m -- -logfile="$LOGFILE" + sudo start-stop-daemon -p "$PIDFILE" -x syncthing -S -b -N 5 -m -- -logfile="$LOGFILE" -home ~/.config/syncthing echo "OK" }