init: DDNS client + Cloudflare Worker + sing-box chunked download
This commit is contained in:
@@ -0,0 +1,158 @@
|
||||
#!/system/bin/sh
|
||||
# Android DDNS reporter
|
||||
#
|
||||
# Reads the current IPv4 address of $IFACE and GETs the Cloudflare Worker
|
||||
# endpoint whenever the IP changes. Uses the system-provided httpurl binary
|
||||
# (HTTP-only, no curl/wget/busybox needed). Token and IP are passed as
|
||||
# query-string parameters.
|
||||
#
|
||||
# Configure via environment variables or by editing the constants below.
|
||||
# Defaults are suitable for /data/local/tmp installation on an Android IPTV box.
|
||||
|
||||
set -u
|
||||
|
||||
# Load optional env file (created by install.sh). This is sourced *before*
|
||||
# the defaults below so values from the file act as overrides rather than
|
||||
# hard-coded constants.
|
||||
DDNS_ENV_FILE="${DDNS_ENV_FILE:-/data/local/tmp/ddns.env}"
|
||||
if [ -f "$DDNS_ENV_FILE" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "$DDNS_ENV_FILE"
|
||||
fi
|
||||
|
||||
# ---- Configuration (override by exporting env vars before calling) ------------
|
||||
WORKER_URL="${DDNS_WORKER_URL:-http://ddns.eachtime.me/update}"
|
||||
TOKEN="${DDNS_TOKEN:-REPLACE_ME_SHARED_TOKEN}"
|
||||
NAME="${DDNS_NAME:-}"
|
||||
IFACE="${DDNS_IFACE:-eth0}"
|
||||
INTERVAL="${DDNS_INTERVAL:-60}"
|
||||
HTTPURL="${DDNS_HTTPURL:-/system/xbin/httpurl}"
|
||||
STATE_FILE="${DDNS_STATE_FILE:-/data/local/tmp/ddns.last}"
|
||||
LOG_FILE="${DDNS_LOG_FILE:-/data/local/tmp/ddns.log}"
|
||||
MAX_LOG_BYTES="${DDNS_MAX_LOG_BYTES:-524288}" # 512 KiB rotation threshold
|
||||
BACKOFF_MAX="${DDNS_BACKOFF_MAX:-600}" # max backoff seconds on failure
|
||||
ONESHOT="${DDNS_ONESHOT:-0}" # 1 = run once and exit
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
DATE_CMD="/system/bin/toybox date"
|
||||
|
||||
log() {
|
||||
# Log with timestamp; rotate if the log exceeds MAX_LOG_BYTES.
|
||||
ts=$($DATE_CMD '+%Y-%m-%d %H:%M:%S')
|
||||
printf '%s %s\n' "$ts" "$*" >>"$LOG_FILE" 2>/dev/null
|
||||
if [ -f "$LOG_FILE" ]; then
|
||||
size=$(/system/bin/toybox stat -c '%s' "$LOG_FILE" 2>/dev/null || echo 0)
|
||||
if [ "${size:-0}" -gt "$MAX_LOG_BYTES" ] 2>/dev/null; then
|
||||
mv "$LOG_FILE" "${LOG_FILE}.1" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
get_ip() {
|
||||
# Auto-detect outbound source IP via routing table (no awk needed).
|
||||
/system/bin/ip -4 route get 8.8.8.8 2>/dev/null \
|
||||
| /system/bin/toybox sed -n 's/.*src \([0-9.]*\).*/\1/p' \
|
||||
| /system/bin/toybox head -n1
|
||||
}
|
||||
|
||||
is_public_ipv4() {
|
||||
# Reject empty, private, CGNAT, link-local, loopback, multicast/reserved.
|
||||
case "$1" in
|
||||
""|0.*|127.*|169.254.*|10.*|192.168.*) return 1 ;;
|
||||
172.16.*|172.17.*|172.18.*|172.19.*|172.2[0-9].*|172.3[0-1].*) return 1 ;;
|
||||
100.6[4-9].*|100.[7-9][0-9].*|100.1[0-1][0-9].*|100.12[0-7].*) return 1 ;;
|
||||
22[4-9].*|23[0-9].*|24[0-9].*|25[0-5].*) return 1 ;;
|
||||
esac
|
||||
# Must match rough IPv4 shape (4 dotted numbers).
|
||||
case "$1" in
|
||||
*.*.*.*) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
send_update() {
|
||||
# $1 = ip. Echoes the JSON response body on stdout.
|
||||
# Exit status: 0 if httpurl succeeded AND response contains "ok":true.
|
||||
ip="$1"
|
||||
url="${WORKER_URL}?t=${TOKEN}&ip=${ip}&name=${NAME}"
|
||||
# httpurl outputs diagnostic lines (Resolving/Connecting) then HTTP headers
|
||||
# then a blank line then the response body, all on stdout.
|
||||
raw=$("$HTTPURL" "$url" 2>&1) || { echo "$raw"; return 1; }
|
||||
# Extract JSON body (first line that starts with '{').
|
||||
body=$(echo "$raw" | grep '^{' | head -n1)
|
||||
echo "$body"
|
||||
# Check for success.
|
||||
echo "$body" | grep -q '"ok":true'
|
||||
}
|
||||
|
||||
run_once() {
|
||||
ip=$(get_ip)
|
||||
if ! is_public_ipv4 "$ip"; then
|
||||
log "skip: no public ipv4 detected (got '$ip')"
|
||||
return 2
|
||||
fi
|
||||
|
||||
last=""
|
||||
[ -f "$STATE_FILE" ] && last=$(cat "$STATE_FILE" 2>/dev/null)
|
||||
|
||||
if [ "$ip" = "$last" ]; then
|
||||
# No change, no request. Keep log quiet.
|
||||
return 0
|
||||
fi
|
||||
|
||||
resp=$(send_update "$ip" 2>&1)
|
||||
rc=$?
|
||||
if [ $rc -eq 0 ]; then
|
||||
printf '%s' "$ip" >"$STATE_FILE"
|
||||
log "ok: $last -> $ip :: $resp"
|
||||
return 0
|
||||
else
|
||||
log "fail($rc): attempt $ip :: $resp"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
main_loop() {
|
||||
backoff=0
|
||||
trap 'log "stopping (signal)"; exit 0' TERM INT
|
||||
log "starting: iface=$IFACE interval=${INTERVAL}s url=$WORKER_URL"
|
||||
while :; do
|
||||
if run_once; then
|
||||
backoff=0
|
||||
sleep "$INTERVAL"
|
||||
else
|
||||
# Exponential backoff capped at BACKOFF_MAX.
|
||||
if [ "$backoff" -eq 0 ]; then
|
||||
backoff="$INTERVAL"
|
||||
else
|
||||
backoff=$((backoff * 2))
|
||||
[ "$backoff" -gt "$BACKOFF_MAX" ] && backoff="$BACKOFF_MAX"
|
||||
fi
|
||||
log "retry in ${backoff}s"
|
||||
sleep "$backoff"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Sanity checks
|
||||
if [ ! -x "$HTTPURL" ]; then
|
||||
log "fatal: httpurl binary not found at $HTTPURL"
|
||||
exit 127
|
||||
fi
|
||||
if [ "$TOKEN" = "REPLACE_ME_SHARED_TOKEN" ]; then
|
||||
log "fatal: DDNS_TOKEN is unset; edit this script or export DDNS_TOKEN"
|
||||
exit 2
|
||||
fi
|
||||
if [ -z "$NAME" ]; then
|
||||
# Auto-derive from device hostname, truncated to first segment.
|
||||
NAME=$(cat /proc/sys/kernel/hostname 2>/dev/null | /system/bin/toybox cut -d_ -f1)
|
||||
[ -z "$NAME" ] && NAME="dd"
|
||||
log "auto name=$NAME (set DDNS_NAME to override)"
|
||||
fi
|
||||
|
||||
if [ "$ONESHOT" = "1" ]; then
|
||||
run_once
|
||||
exit $?
|
||||
fi
|
||||
|
||||
main_loop
|
||||
@@ -0,0 +1,78 @@
|
||||
#!/system/bin/sh
|
||||
# Foreground wrapper that daemonizes ddns-report.sh.
|
||||
#
|
||||
# Usage:
|
||||
# /data/local/tmp/ddns-runner.sh start # start in background (nohup)
|
||||
# /data/local/tmp/ddns-runner.sh stop # stop the running instance
|
||||
# /data/local/tmp/ddns-runner.sh status # print pid + last log lines
|
||||
# /data/local/tmp/ddns-runner.sh restart
|
||||
#
|
||||
# The main script path and pid file can be overridden via env vars.
|
||||
|
||||
SCRIPT="${DDNS_SCRIPT:-/data/local/tmp/ddns-report.sh}"
|
||||
PIDFILE="${DDNS_PIDFILE:-/data/local/tmp/ddns.pid}"
|
||||
LOG_FILE="${DDNS_LOG_FILE:-/data/local/tmp/ddns.log}"
|
||||
|
||||
is_running() {
|
||||
[ -f "$PIDFILE" ] || return 1
|
||||
pid=$(cat "$PIDFILE" 2>/dev/null)
|
||||
[ -n "$pid" ] || return 1
|
||||
# kill -0 tests existence without signaling.
|
||||
kill -0 "$pid" 2>/dev/null
|
||||
}
|
||||
|
||||
cmd_start() {
|
||||
if is_running; then
|
||||
echo "already running (pid=$(cat "$PIDFILE"))"
|
||||
return 0
|
||||
fi
|
||||
if [ ! -x "$SCRIPT" ]; then
|
||||
echo "script not executable: $SCRIPT" >&2
|
||||
return 127
|
||||
fi
|
||||
# nohup detaches from the shell; setsid would be cleaner but toybox does
|
||||
# not guarantee it on every Android build.
|
||||
nohup "$SCRIPT" >/dev/null 2>&1 &
|
||||
pid=$!
|
||||
echo "$pid" >"$PIDFILE"
|
||||
echo "started pid=$pid"
|
||||
}
|
||||
|
||||
cmd_stop() {
|
||||
if ! is_running; then
|
||||
echo "not running"
|
||||
rm -f "$PIDFILE"
|
||||
return 0
|
||||
fi
|
||||
pid=$(cat "$PIDFILE")
|
||||
kill "$pid" 2>/dev/null
|
||||
# Wait up to 5s, then SIGKILL.
|
||||
i=0
|
||||
while kill -0 "$pid" 2>/dev/null && [ $i -lt 5 ]; do
|
||||
sleep 1
|
||||
i=$((i + 1))
|
||||
done
|
||||
kill -0 "$pid" 2>/dev/null && kill -9 "$pid" 2>/dev/null
|
||||
rm -f "$PIDFILE"
|
||||
echo "stopped pid=$pid"
|
||||
}
|
||||
|
||||
cmd_status() {
|
||||
if is_running; then
|
||||
echo "running pid=$(cat "$PIDFILE")"
|
||||
else
|
||||
echo "stopped"
|
||||
fi
|
||||
if [ -f "$LOG_FILE" ]; then
|
||||
echo "--- last 10 log lines ---"
|
||||
/system/bin/toybox tail -n 10 "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
start) cmd_start ;;
|
||||
stop) cmd_stop ;;
|
||||
restart) cmd_stop; cmd_start ;;
|
||||
status) cmd_status ;;
|
||||
*) echo "usage: $0 {start|stop|restart|status}" >&2; exit 2 ;;
|
||||
esac
|
||||
@@ -0,0 +1,20 @@
|
||||
# Android init service definition for the DDNS reporter.
|
||||
#
|
||||
# Install: push this file to /system/etc/init/ddns.rc (chmod 644, chown root:root)
|
||||
# and reboot the device. `sys.boot_completed=1` triggers the service after the
|
||||
# boot animation finishes.
|
||||
#
|
||||
# NOTE: Android's init enforces SELinux. On many devices the `su` domain cannot
|
||||
# be entered by init. If `logcat -s init:*` shows a denial, use the nohup
|
||||
# fallback documented in README.md instead.
|
||||
|
||||
service ddns /system/bin/sh /data/local/tmp/ddns-report.sh
|
||||
class late_start
|
||||
user root
|
||||
group root
|
||||
oneshot
|
||||
disabled
|
||||
seclabel u:r:su:s0
|
||||
|
||||
on property:sys.boot_completed=1
|
||||
start ddns
|
||||
@@ -0,0 +1,256 @@
|
||||
#!/system/bin/sh
|
||||
# Android DDNS client installer.
|
||||
#
|
||||
# Run directly on the Android device (via telnet / serial / adb shell).
|
||||
# Writes ddns-report.sh, ddns-runner.sh, and ddns.env to $PREFIX,
|
||||
# then starts the daemon.
|
||||
#
|
||||
# Usage (on the box):
|
||||
# sh install.sh --token SECRET [--name p291] [--url http://...] [--iface eth0]
|
||||
|
||||
PREFIX="/data/local/tmp"
|
||||
|
||||
WORKER_URL="http://ddns.eachtime.me/update"
|
||||
TOKEN="123456789"
|
||||
NAME="p291"
|
||||
IFACE="eth0"
|
||||
INTERVAL="60"
|
||||
SKIP_START=0
|
||||
|
||||
usage() {
|
||||
echo "usage: install.sh [options]"
|
||||
echo " --url URL Worker HTTP URL (default: http://ddns.eachtime.me/update)"
|
||||
echo " --token TOKEN shared bearer token (required)"
|
||||
echo " --name PREFIX subdomain prefix (e.g. p291 -> p291.eachtime.me)"
|
||||
echo " --iface NAME network interface (default: eth0)"
|
||||
echo " --interval SECS poll interval (default: 60)"
|
||||
echo " --skip-start install but don't start daemon"
|
||||
echo " -h, --help show this help"
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--url) WORKER_URL="$2"; shift 2 ;;
|
||||
--token) TOKEN="$2"; shift 2 ;;
|
||||
--name) NAME="$2"; shift 2 ;;
|
||||
--iface) IFACE="$2"; shift 2 ;;
|
||||
--interval) INTERVAL="$2"; shift 2 ;;
|
||||
--skip-start) SKIP_START=1; shift ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) echo "unknown option: $1" >&2; usage; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "error: --token is required" >&2
|
||||
usage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "[1/3] writing config"
|
||||
cat > "$PREFIX/ddns.env" << ENVEOF
|
||||
DDNS_WORKER_URL='$WORKER_URL'
|
||||
DDNS_TOKEN='$TOKEN'
|
||||
DDNS_NAME='$NAME'
|
||||
DDNS_IFACE='$IFACE'
|
||||
DDNS_INTERVAL='$INTERVAL'
|
||||
ENVEOF
|
||||
chmod 600 "$PREFIX/ddns.env"
|
||||
|
||||
echo "[2/3] writing scripts"
|
||||
cat > "$PREFIX/ddns-report.sh" << 'REPORTEOF'
|
||||
#!/system/bin/sh
|
||||
set -u
|
||||
DDNS_ENV_FILE="${DDNS_ENV_FILE:-/data/local/tmp/ddns.env}"
|
||||
if [ -f "$DDNS_ENV_FILE" ]; then
|
||||
. "$DDNS_ENV_FILE"
|
||||
fi
|
||||
WORKER_URL="${DDNS_WORKER_URL:-http://ddns.eachtime.me/update}"
|
||||
TOKEN="${DDNS_TOKEN:-REPLACE_ME_SHARED_TOKEN}"
|
||||
NAME="${DDNS_NAME:-}"
|
||||
IFACE="${DDNS_IFACE:-eth0}"
|
||||
INTERVAL="${DDNS_INTERVAL:-60}"
|
||||
HTTPURL="${DDNS_HTTPURL:-/system/xbin/httpurl}"
|
||||
STATE_FILE="${DDNS_STATE_FILE:-/data/local/tmp/ddns.last}"
|
||||
LOG_FILE="${DDNS_LOG_FILE:-/data/local/tmp/ddns.log}"
|
||||
MAX_LOG_BYTES="${DDNS_MAX_LOG_BYTES:-524288}"
|
||||
BACKOFF_MAX="${DDNS_BACKOFF_MAX:-600}"
|
||||
ONESHOT="${DDNS_ONESHOT:-0}"
|
||||
DATE_CMD="/system/bin/toybox date"
|
||||
log() {
|
||||
ts=$($DATE_CMD '+%Y-%m-%d %H:%M:%S')
|
||||
printf '%s %s\n' "$ts" "$*" >>"$LOG_FILE" 2>/dev/null
|
||||
if [ -f "$LOG_FILE" ]; then
|
||||
size=$(/system/bin/toybox stat -c '%s' "$LOG_FILE" 2>/dev/null || echo 0)
|
||||
if [ "${size:-0}" -gt "$MAX_LOG_BYTES" ] 2>/dev/null; then
|
||||
mv "$LOG_FILE" "${LOG_FILE}.1" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
get_ip() {
|
||||
/system/bin/ip -4 route get 8.8.8.8 2>/dev/null \
|
||||
| /system/bin/toybox sed -n 's/.*src \([0-9.]*\).*/\1/p' \
|
||||
| /system/bin/toybox head -n1
|
||||
}
|
||||
is_public_ipv4() {
|
||||
case "$1" in
|
||||
""|0.*|127.*|169.254.*|10.*|192.168.*) return 1 ;;
|
||||
172.16.*|172.17.*|172.18.*|172.19.*|172.2[0-9].*|172.3[0-1].*) return 1 ;;
|
||||
100.6[4-9].*|100.[7-9][0-9].*|100.1[0-1][0-9].*|100.12[0-7].*) return 1 ;;
|
||||
22[4-9].*|23[0-9].*|24[0-9].*|25[0-5].*) return 1 ;;
|
||||
esac
|
||||
case "$1" in
|
||||
*.*.*.*) return 0 ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
send_update() {
|
||||
ip="$1"
|
||||
url="${WORKER_URL}?t=${TOKEN}&ip=${ip}&name=${NAME}"
|
||||
raw=$("$HTTPURL" "$url" 2>&1) || { echo "$raw"; return 1; }
|
||||
body=$(echo "$raw" | grep '^{' | head -n1)
|
||||
echo "$body"
|
||||
echo "$body" | grep -q '"ok":true'
|
||||
}
|
||||
run_once() {
|
||||
ip=$(get_ip)
|
||||
if ! is_public_ipv4 "$ip"; then
|
||||
log "skip: no public ipv4 detected (got '$ip')"
|
||||
return 2
|
||||
fi
|
||||
last=""
|
||||
[ -f "$STATE_FILE" ] && last=$(cat "$STATE_FILE" 2>/dev/null)
|
||||
if [ "$ip" = "$last" ]; then
|
||||
return 0
|
||||
fi
|
||||
resp=$(send_update "$ip" 2>&1)
|
||||
rc=$?
|
||||
if [ $rc -eq 0 ]; then
|
||||
printf '%s' "$ip" >"$STATE_FILE"
|
||||
log "ok: $last -> $ip :: $resp"
|
||||
return 0
|
||||
else
|
||||
log "fail($rc): attempt $ip :: $resp"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
main_loop() {
|
||||
backoff=0
|
||||
trap 'log "stopping (signal)"; exit 0' TERM INT
|
||||
log "starting: iface=$IFACE interval=${INTERVAL}s url=$WORKER_URL"
|
||||
while :; do
|
||||
if run_once; then
|
||||
backoff=0
|
||||
sleep "$INTERVAL"
|
||||
else
|
||||
if [ "$backoff" -eq 0 ]; then
|
||||
backoff="$INTERVAL"
|
||||
else
|
||||
backoff=$((backoff * 2))
|
||||
[ "$backoff" -gt "$BACKOFF_MAX" ] && backoff="$BACKOFF_MAX"
|
||||
fi
|
||||
log "retry in ${backoff}s"
|
||||
sleep "$backoff"
|
||||
fi
|
||||
done
|
||||
}
|
||||
if [ ! -x "$HTTPURL" ]; then
|
||||
log "fatal: httpurl binary not found at $HTTPURL"
|
||||
exit 127
|
||||
fi
|
||||
if [ "$TOKEN" = "REPLACE_ME_SHARED_TOKEN" ]; then
|
||||
log "fatal: DDNS_TOKEN is unset"
|
||||
exit 2
|
||||
fi
|
||||
if [ -z "$NAME" ]; then
|
||||
NAME=$(cat /proc/sys/kernel/hostname 2>/dev/null | /system/bin/toybox cut -d_ -f1)
|
||||
[ -z "$NAME" ] && NAME="dd"
|
||||
log "auto name=$NAME (set DDNS_NAME to override)"
|
||||
fi
|
||||
if [ "$ONESHOT" = "1" ]; then
|
||||
run_once
|
||||
exit $?
|
||||
fi
|
||||
main_loop
|
||||
REPORTEOF
|
||||
|
||||
cat > "$PREFIX/ddns-runner.sh" << 'RUNEOF'
|
||||
#!/system/bin/sh
|
||||
SCRIPT="${DDNS_SCRIPT:-/data/local/tmp/ddns-report.sh}"
|
||||
PIDFILE="${DDNS_PIDFILE:-/data/local/tmp/ddns.pid}"
|
||||
LOG_FILE="${DDNS_LOG_FILE:-/data/local/tmp/ddns.log}"
|
||||
is_running() {
|
||||
[ -f "$PIDFILE" ] || return 1
|
||||
pid=$(cat "$PIDFILE" 2>/dev/null)
|
||||
[ -n "$pid" ] || return 1
|
||||
kill -0 "$pid" 2>/dev/null
|
||||
}
|
||||
cmd_start() {
|
||||
if is_running; then
|
||||
echo "already running (pid=$(cat "$PIDFILE"))"
|
||||
return 0
|
||||
fi
|
||||
if [ ! -x "$SCRIPT" ]; then
|
||||
echo "script not executable: $SCRIPT" >&2
|
||||
return 127
|
||||
fi
|
||||
nohup "$SCRIPT" >/dev/null 2>&1 &
|
||||
pid=$!
|
||||
echo "$pid" >"$PIDFILE"
|
||||
echo "started pid=$pid"
|
||||
}
|
||||
cmd_stop() {
|
||||
if ! is_running; then
|
||||
echo "not running"
|
||||
rm -f "$PIDFILE"
|
||||
return 0
|
||||
fi
|
||||
pid=$(cat "$PIDFILE")
|
||||
kill "$pid" 2>/dev/null
|
||||
i=0
|
||||
while kill -0 "$pid" 2>/dev/null && [ $i -lt 5 ]; do
|
||||
sleep 1
|
||||
i=$((i + 1))
|
||||
done
|
||||
kill -0 "$pid" 2>/dev/null && kill -9 "$pid" 2>/dev/null
|
||||
rm -f "$PIDFILE"
|
||||
echo "stopped pid=$pid"
|
||||
}
|
||||
cmd_status() {
|
||||
if is_running; then
|
||||
echo "running pid=$(cat "$PIDFILE")"
|
||||
else
|
||||
echo "stopped"
|
||||
fi
|
||||
if [ -f "$LOG_FILE" ]; then
|
||||
echo "--- last 10 log lines ---"
|
||||
/system/bin/toybox tail -n 10 "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
case "${1:-}" in
|
||||
start) cmd_start ;;
|
||||
stop) cmd_stop ;;
|
||||
restart) cmd_stop; cmd_start ;;
|
||||
status) cmd_status ;;
|
||||
*) echo "usage: $0 {start|stop|restart|status}" >&2; exit 2 ;;
|
||||
esac
|
||||
RUNEOF
|
||||
|
||||
chmod 755 "$PREFIX/ddns-report.sh" "$PREFIX/ddns-runner.sh"
|
||||
|
||||
echo "[3/3] testing & starting"
|
||||
# One-shot test first
|
||||
DDNS_ONESHOT=1 "$PREFIX/ddns-report.sh"
|
||||
echo ""
|
||||
cat "$PREFIX/ddns.log" 2>/dev/null | /system/bin/toybox tail -n 5
|
||||
echo ""
|
||||
|
||||
if [ "$SKIP_START" = "1" ]; then
|
||||
echo "skipped start. run: $PREFIX/ddns-runner.sh start"
|
||||
else
|
||||
"$PREFIX/ddns-runner.sh" start
|
||||
"$PREFIX/ddns-runner.sh" status
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "done. logs: cat $PREFIX/ddns.log"
|
||||
Reference in New Issue
Block a user