mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
27 lines
827 B
Bash
Executable File
27 lines
827 B
Bash
Executable File
#!/bin/sh
|
|
. /etc/profile
|
|
HOSTNAME=$(get_setting system.hostname)
|
|
echo ${HOSTNAME} >/proc/sys/kernel/hostname
|
|
hostnamectl --transient hostname ${HOSTNAME}
|
|
avahi-set-host-name ${HOSTNAME}
|
|
|
|
rm -f /run/archr/hosts
|
|
if [ -f /storage/.config/hosts.conf ]; then
|
|
cat /storage/.config/hosts.conf > /run/archr/hosts
|
|
fi
|
|
|
|
# RESOLUTION ORDER:
|
|
# 1. USER OVERRIDE: /storage/.config/resolv.conf exists -> Use it directly.
|
|
# 2. DYNAMIC/STUB: No override -> Symlink to systemd-resolved stub.
|
|
if [ -f /storage/.config/resolv.conf ]; then
|
|
rm -f /run/archr/resolv.conf
|
|
cat /storage/.config/resolv.conf > /run/archr/resolv.conf
|
|
else
|
|
TARGET="/run/systemd/resolve/stub-resolv.conf"
|
|
LINK="/run/archr/resolv.conf"
|
|
if [ ! -L "$LINK" ] || [ "$(readlink "$LINK")" != "$TARGET" ]; then
|
|
rm -f "$LINK"
|
|
ln -sf "$TARGET" "$LINK"
|
|
fi
|
|
fi
|