all bullshit OUT
This commit is contained in:
+3
-3
@@ -12,14 +12,14 @@ fi
|
||||
[ -n "$pids" ] || exit 0
|
||||
|
||||
# Send TERM first
|
||||
kill -TERM $pids 2>/dev/null || true
|
||||
kill -TERM "$pids" 2>/dev/null || true
|
||||
|
||||
# Optional: hard kill if still alive after a short grace
|
||||
sleep 0.2
|
||||
sleep 1 # uhhh sleep is stupid
|
||||
remain=""
|
||||
for p in $pids; do
|
||||
kill -0 "$p" 2>/dev/null && remain="$remain $p"
|
||||
done
|
||||
[ -z "$remain" ] || kill -KILL $remain 2>/dev/null || true
|
||||
[ -z "$remain" ] || kill -KILL "$remain" 2>/dev/null || true
|
||||
|
||||
exit 0
|
||||
@@ -45,7 +45,6 @@ fetch() {
|
||||
if command -v uclient-fetch >/dev/null 2>&1; then
|
||||
uclient-fetch -O "$2" "$1" || return 1
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
# shellcheck disable=SC2086
|
||||
wget ${WAKEY_INSECURE:+--no-check-certificate} -O "$2" "$1" || return 1
|
||||
elif command -v curl >/dev/null 2>&1; then
|
||||
if [ -n "${WAKEY_INSECURE:-}" ]; then
|
||||
@@ -96,6 +95,7 @@ main() {
|
||||
|
||||
if [ -f /etc/init.d/wakey ]; then
|
||||
chmod +x /etc/init.d/wakey || true
|
||||
chmod +x /etc/init.d/kill_wakey.sh || true
|
||||
/etc/init.d/wakey enable || true
|
||||
/etc/init.d/wakey restart || /etc/init.d/wakey start || true
|
||||
fi
|
||||
|
||||
@@ -29,6 +29,7 @@ New-Item -ItemType Directory -Force -Path $rootDir | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $etcDir | Out-Null
|
||||
|
||||
Copy-Item $binSrc (Join-Path $rootDir "wakey") -Force
|
||||
Copy-Item (Join-Path $root 'scripts/kill.sh') (Join-Path $rootDir "kill_wakey.sh") -Force
|
||||
|
||||
# Copy all OpenWrt init scripts present in repo
|
||||
Get-ChildItem (Join-Path $root 'scripts/init/openwrt') -File | ForEach-Object {
|
||||
@@ -65,3 +66,4 @@ Write-Host "Rootfs package: " (Join-Path $dist $pkgName)
|
||||
Write-Host "On router: wget -O- <URL/$pkgName> | tar -xz -C /"
|
||||
Write-Host "Then: chmod +x /etc/init.d/wakey && /etc/init.d/wakey enable && /etc/init.d/wakey start"
|
||||
Write-Host "Helper scripts: /etc/ldlda_help/* (e.g., update_wakey.sh, update_tailscale.sh). Mark executable if needed: chmod +x /etc/ldlda_help/*.sh"
|
||||
Write-Host "Kill helper: /root/.bin/kill_wakey.sh (make it executable: chmod +x /root/.bin/kill_wakey.sh)"
|
||||
|
||||
Reference in New Issue
Block a user