Skip to content

Commit

Permalink
Remove hostname dependency for Archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
alimirjamali committed Jan 14, 2025
1 parent 74d07bb commit 8fb5147
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions archlinux/PKGBUILD.install
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ update_qubesconfig() {
if ! grep -q localhost /etc/hosts; then

cat <<EOF > /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 $(hostname)
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 $(cat /etc/hostname)
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
EOF

Expand All @@ -126,10 +126,10 @@ EOF
if ! is_protected_file /etc/hostname ; then
for ip in '127\.0\.0\.1' '::1'; do
if grep -q "^${ip}\(\s\|$\)" /etc/hosts; then
sed -i "/^${ip}\s/,+0s/\(\s$(hostname)\)\+\(\s\|$\)/\2/g" /etc/hosts
sed -i "s/^${ip}\(\s\|$\).*$/\0 $(hostname)/" /etc/hosts
sed -i "/^${ip}\s/,+0s/\(\s$(cat /etc/hostname)\)\+\(\s\|$\)/\2/g" /etc/hosts
sed -i "s/^${ip}\(\s\|$\).*$/\0 $(cat /etc/hostname)/" /etc/hosts
else
echo "${ip} $(hostname)" >> /etc/hosts
echo "${ip} $(cat /etc/hostname)" >> /etc/hosts
fi
done
fi
Expand Down

0 comments on commit 8fb5147

Please sign in to comment.