1
mirror of git://git.acid.vegas/random.git synced 2024-12-04 13:36:39 +00:00
random/ovh6
2023-06-27 19:21:24 -04:00

10 lines
429 B
Bash
Executable File

#!/bin/sh
_ADDRESS="2001:0000:000:0000:0:0:0:0000"
_GATEWAY="2001:0000:0000:0000:0000:0000:0000:0000"
_PERSIST=1
if [ $_PERSIST -eq 1 ]; then
echo -r "[Match]\nName=eth0\n\n[Network]\nDHCP=ipv4\n\nAddress=$_ADDRESS\nGateway=$_GATEWAY\n\n[DHCP]\nUseMTU=true" > /etc/systemd/network/eth0-dhcp.network
else
ip addr add $_ADDRESS/64 dev eth0 & ip -6 route add $_GATEWAY dev eth0 & ip -6 route add default via $_GATEWAY dev eth0
fi