-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.sh
More file actions
33 lines (27 loc) · 764 Bytes
/
Copy pathservice.sh
File metadata and controls
33 lines (27 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/system/bin/sh
# Jalankan daemon rclone rcd saat boot jika /data/adb/rclone/.autostart ada
MODDIR=${0%/*}
RC_DIR="/data/adb/rclone"
BIN="$MODDIR/system/bin/rclone"
CONF="$RC_DIR/rclone.conf"
LOGF="$RC_DIR/rcd.log"
PIDF="$RC_DIR/rcd.pid"
ADDR="127.0.0.1:5572"
(
# Tunggu boot selesai
until [ "$(getprop sys.boot_completed)" = "1" ]; do
sleep 3
done
sleep 5
[ -f "$RC_DIR/.autostart" ] || exit 0
[ -x "$BIN" ] || exit 0
mkdir -p "$RC_DIR"
# Hindari duplikat proses
if [ -f "$PIDF" ] && kill -0 "$(cat "$PIDF")" 2>/dev/null; then
exit 0
fi
ARGS="--config $CONF --log-file $LOGF --log-level INFO --rc-addr $ADDR"
[ -f "$RC_DIR/.webgui" ] && ARGS="$ARGS --rc-web-gui"
"$BIN" rcd $ARGS >/dev/null 2>&1 &
echo $! > "$PIDF"
) &