| #! /bin/sh |
| |
| exec 2>&1 |
| |
| run() { |
| echo --------------------------------------------------------------- |
| echo "$*" |
| "$@" |
| } |
| |
| # Generic device information. |
| run date |
| run grep . /etc/platform /etc/version /etc/softwaredate /etc/serial |
| run sh -c 'grep . /tmp/gpio/* /tmp/gpio/*/*; cd /tmp/gpio/ledcontrol; echo $(pwd): *' |
| run ip addr |
| run ip -d link |
| run ls -l /tmp/babysit* |
| run grep . /tmp/babysit* |
| run ls -l /config |
| run ls -l /config/experiments |
| run cat /rw/startupmods |
| run hnvram -d |
| |
| # SSL certificate validation. |
| echo --------------------------------------------------------------- |
| http_response=$(curl -s -S "https://factory.cpe.gfsvc.com/check_certs" --data "$(serial)") |
| cert_in_cars=$(echo "$http_response" | grep "resultCode='0'") |
| if [ -n "$cert_in_cars" ]; then |
| echo "SSL certificate for $(serial) is available in CARS!" |
| else |
| echo "Warning! SSL certificate for $(serial) was *NOT* uploaded to CARS yet!" |
| fi |
| echo |
| device_cert=$(hnvram -qr GOOGLE_SSL_CRT) |
| echo "SSL certificate from hnvram:" |
| echo "$device_cert" |
| echo |
| |
| http_response=$(curl -s -S "https://factory.cpe.gfsvc.com/fetch_certs" --data "$(serial)") |
| cert=$(echo "$http_response" | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p') |
| echo "SSL certificate from CARS:" |
| echo "$cert" |
| echo |
| |
| # Device-specific diagnostic information. |
| if is-ptp; then |
| run grep . /config/settings/* |
| run cat /config/glaukus.properties |
| run sh -c "ps agxww | grep glaukus" |
| run sh -c "ps agxww | grep cpss" |
| run sh -c 'curl -s http://localhost:8080/api/modem; echo ""' |
| run sh -c 'curl -s http://localhost:8080/api/radio; echo ""' |
| run presterastats |
| fi |
| |
| if is-fiberjack; then |
| run pgrep sycl |
| run cat /sys/devices/platform/gpon/info/alarmGpon |
| run cat /sys/devices/platform/gpon/info/infoGpon |
| run cat /sys/devices/platform/gpon/misc/laserChannel |
| run i2cdetect -y 0 |
| run i2cdump -y 0 0x50 |
| run i2cdump -y 0 0x51 |
| fi |