summaryrefslogtreecommitdiff
path: root/nonprism/hostname-blanker/hostname-blanker.sh
blob: ecdcfd4b4613ec72b84046a0d1fb8f10a7488a7f (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
# This script wipes hostname so that DHCP can't send it over the network
#hostnamectl set-hostname localhost
echo "localhost" > /etc/hostname
wait
sed -i '/127.0.0.1/c\127.0.0.1       localhost.localdomain   localhost 'localhost'' /etc/hosts  ##properly sets our new host in /etc/hosts file
wait
sysctl kernel.hostname=localhost
wait
hostname localhost ##avoids need to reboot before showing our new hostname in terminals etc.
wait