distribution/packages/sysutils/systemd/scripts/network-base-setup

27 lines
652 B
Text
Raw Normal View History

2022-02-05 14:23:32 +00:00
#!/bin/sh
# setup hostname
2022-02-28 21:31:20 +00:00
if [ -f /storage/.cache/hostname ]; then
cat /storage/.cache/hostname > /proc/sys/kernel/hostname
fi
2022-02-05 14:23:32 +00:00
# setup /etc/hosts
rm -f /run/libreelec/hosts
if [ -f /storage/.config/hosts.conf ]; then
cat /storage/.config/hosts.conf > /run/libreelec/hosts
fi
# setup /etc/resolv.conf
rm -f /run/libreelec/resolv.conf
if [ -f /storage/.config/resolv.conf ]; then
cat /storage/.config/resolv.conf > /run/libreelec/resolv.conf
elif [ -f /dev/.kernel_ipconfig -a -f /proc/net/pnp ]; then
cat /proc/net/pnp > /run/libreelec/resolv.conf
else
cat << EOF > /run/libreelec/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
EOF
fi