blob: fb904c10cd41fff915b8cc36356d9f4df24804cb [file] [log] [blame]
Jan Kundrát55fb0642020-03-27 18:44:19 +01001#!/bin/sh
2
3set -ex
4
5for candidate in osc oscW eth2; do
6 if [[ -d "/sys/class/net/${candidate}" ]]; then
7 NETDEV="${candidate}"
8 break
9 fi
10done
11
12if [[ ! -n "${NETDEV+set}" ]]; then
13 echo "Unrecognized SFP device name"
14 exit 1
15fi
16
17# SFP: green lit for "link"
18# SFP: green blinking for activity
19cd /sys/class/leds/sfp:green
20echo netdev > trigger
21echo "${NETDEV}" > device_name
22echo 1 > link
23echo 1 > rx
24echo 1 > tx