- GitHub Staff
- https://tippybits.com
- @dtaivpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
hostname=$1 | |
ip=$2 # should be of format: 192.168.1.100 | |
dns=$3 # should be of format: 192.168.1.1 | |
# Change the hostname | |
sudo hostnamectl --transient set-hostname $hostname | |
sudo hostnamectl --static set-hostname $hostname | |
sudo hostnamectl --pretty set-hostname $hostname |