Skip to content

Commit

Permalink
update post-fs-data
Browse files Browse the repository at this point in the history
  • Loading branch information
eventlOwOp committed Jul 1, 2024
1 parent ef70054 commit 38cadb6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
19 changes: 19 additions & 0 deletions magisk/post-fs-data.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ZTROOT=/data/adb/zerotier
APPROOT=/data/user/0/com.eventlowop.zerotier_magisk_app/app_flutter
authtoken=$ZTROOT/home/authtoken.secret
daemon_log=$ZTROOT/run/daemon.log
pipe=$ZTROOT/run/pipe

log() {
t=`date +"%m-%d %H:%M:%S.%3N"`
echo -e "[$t][$$][L] $1" >> $daemon_log
}

if [[ -e $APPROOT ]]; then
log "found controller app"

ln -sf $pipe $APPROOT/pipe
ln -sf $authtoken $APPROOT/authtoken
else
log "controller app not found"
fi
13 changes: 1 addition & 12 deletions magisk/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MODDIR=${0%/*}

ZTROOT=/data/adb/zerotier
ZTRUNTIME=$ZTROOT/run
APPROOT=/data/data/com.eventlowop.zerotier_magisk_app/app_flutter
APPROOT=/data/user/0/com.eventlowop.zerotier_magisk_app/app_flutter

pipe=$ZTRUNTIME/pipe
ZTLOG=$ZTRUNTIME/zerotier.log
Expand Down Expand Up @@ -77,17 +77,6 @@ ip rule add from all lookup main pref 1
ip -6 rule add from all lookup main pref 1
export LD_LIBRARY_PATH=/system/lib64:/data/adb/zerotier/lib

if [[ -e $APPROOT ]]; then
log "found controller app"

ln -sf $pipe $APPROOT/pipe
ln -sf $cli_output $APPROOT/cli.out
ln -sf $cli_pid $APPROOT/cli.pid
ln -sf $authtoken $APPROOT/authtoken
else
log "controller app not found"
fi

__start

while true
Expand Down

0 comments on commit 38cadb6

Please sign in to comment.