Skip to content

Instantly share code, notes, and snippets.

@xiongnemo
Created February 23, 2022 12:13
Show Gist options
  • Save xiongnemo/023a62de988a4d8dc032c7b7323b6582 to your computer and use it in GitHub Desktop.
Save xiongnemo/023a62de988a4d8dc032c7b7323b6582 to your computer and use it in GitHub Desktop.
#!/bin/sh
# $1: new hostname
hostname $1
echo $1 > /etc/hostname
echo "127.0.1.1 "$1 >> /etc/hosts
hostnamectl set-hostname $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment