Files
zkldi_Tachi/server/hosts.sh
T
2021-11-03 00:32:22 +00:00

13 lines
242 B
Bash
Executable File

#!/bin/bash
hostname=$(hostname)
ip=$(hostname -i)
cp /etc/hosts ~/hosts
sed -i 's/127\.0\.0\.1\s+/127\.0\.0\.1 localhost.localdomain /' ~/hosts
sed -i "s/${ip}\s+/${ip} ${hostname}.localdomain /" ~/hosts
cp ~/hosts /etc/hosts
rm ~/hosts