Hamato

by hamatoner
0 deployments · 0 still active · last rev. 2 years ago

belajar

Compatible with: CentOS 5.6
						#!/bin/bash
# This block defines the variables the user of the script needs to input
# when deploying using this script. 
# 
# 
#<UDF name="hostname" label="The hostname for the new Linode.">
# HOSTNAME= 
# 
#<UDF name="fqdn" label="The new Linode's Fully Qualified Domain Name">
# FQDN=
      
# This sets the variable $IPADDR to the IP address the new Linode receives. 
IPADDR=$(/sbin/ifconfig eth0 | awk '/inet / { print $2 }' | sed 's/addr://')
     
# This updates the packages on the system from the distribution repositories. 
apt-get update 
apt-get upgrade -y
   
# This section sets the hostname. 
echo $HOSTNAME > /etc/hostname 
hostname -F /etc/hostname
      
# This section sets the Fully Qualified Domain Name (FQDN) in the hosts file. 
echo $IPADDR $FQDN $HOSTNAME >> /etc/hosts