Skip to content

Commit f3a0477

Browse files
committed
hosts change
1 parent 9a9bb84 commit f3a0477

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ func main() {
125125
cmd = exec.Command("hostnamectl", "set-hostname", hostname)
126126
cmd.Run()
127127

128+
//hostsの変更
129+
cmd = exec.Command("sudo", "sed", "-i", "/etc/hosts", "-e", "s/raspberrypi/"+hostname+"/g", "/etc/hosts")
130+
cmd.Run()
131+
128132
//再起動
129133
log.Println("=====Reboot=====")
130134

0 commit comments

Comments
 (0)