mirror of
https://github.com/PiMaker/rvc.git
synced 2025-02-17 23:20:07 +00:00
honestly forgot what I added all over the last year or so, but here you go, enjoy more cursed code
19 lines
390 B
Bash
Executable File
19 lines
390 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "Configuring network..."
|
|
|
|
# Start loopback interface, it will auto-assign 127.0.0.1/8 as IP
|
|
ip link set up lo
|
|
|
|
PLID=$(cat /sys/kernel/rvc/player_id)
|
|
echo "Player ID: $PLID"
|
|
PLID=$(( (PLID + 1) % 255 ))
|
|
echo "Network ID: $PLID"
|
|
|
|
# Configure rvcnet for external networking
|
|
ip link set dev rvcnet up
|
|
ip addr add "10.0.0.$PLID/24" dev rvcnet
|
|
|
|
echo "Network state:"
|
|
ip addr show
|