Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scripts:
- - &hostname_config |
- #!/bin/sh
- sed -i 's/127.0.1.1.*//' /etc/hosts
- fqdn=`curl -H "X-Google-Metadata-Request: True" "http://metadata/computeMetadata/v1/instance/attributes/host_fqdn"`
- host=`echo $h | cut -d "." -f1`
- ipaddr=`ip addr show eth0 | grep "inet " | awk '{print $2}' | cut -d "/" -f1`
- echo $ipaddr $fqdn $host >> /etc/hosts
- hostname $host
- runcmd:
- - [ sh, -c, *hostname_config ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement