op-packages/luci-app-pppwn/root/etc/init.d/pppwn
github-actions[bot] 5eb416f3e2 🐶 Sync 2026-04-18 02:04:09
2026-04-18 02:04:09 +08:00

26 lines
563 B
Bash
Executable File

#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2022 OpenWrt.org
START=99
PROG=/usr/bin/pppwn
start() {
config_load "pppwn"
config_get "port" "config" "port"
config_get "fwver" "config" "fwver"
local enable
config_get_bool enable config enable 0
[ "${enable}" -gt 0 ] || return
$PROG --interface $port --fw $fwver --stage1 "/etc/pppwn/stage1.bin" --stage2 "/etc/pppwn/stage2.bin" -a > /var/log/pppwn.log &
}
stop() {
ps -w | grep -v "grep" | grep "$PROG" | awk '{print $1}' | xargs kill -9 >/dev/null 2>&1 &
echo "" > /var/log/pppwn.log
}