Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # DEBUG [OFF]
- #DEBUG_N1="> /dev/null"
- #DEBUG_N2="&> /dev/null"
- #SHOWCOMMAND=""
- # DEBUG [ON]
- DEBUG_N1=""
- DEBUG_N2=""
- SHOWCOMMAND="set -x"
- $SHOWCOMMAND
- echo "Generating en_US.UTF-8 locale..."
- locale-gen en_US.UTF-8 $DEBUG_N1
- touch /etc/default/locale
- echo "LANG=\"en_US.UTF-8\"" > /etc/default/locale
- echo "LANGUAGE=\"en_US:en\"" >> /etc/default/locale
- echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale # Solve (Hopefully) error messages when accessing the server through SSH
- echo "Done!!!"
- sleep 1
- echo "Updating package tree..."
- sed -i 's/# deb/deb/' /etc/apt/sources.list # Edit the sources.list file to enable all repositories
- apt-get update $DEBUG_N1
- echo "Done!!!"
- sleep 1
- echo "Installing Kernel..."
- apt-get install linux-image-extra-3.13.0-40-generic # This "extra" kernel brings far more modules (aka device drivers) than the "non-extra" version
- # This command also install grub-pc, which is goood!!!
- echo "Done!!!"
- sleep 1
- echo "Installing btrfs-tools..."
- apt-get -y install btrfs-tools # The -y stands for "awnser YES to all questions"
- echo "Done!!!"
- sleep 1
- echo -n "Enter a hostname: "
- read HOSTNAME
- echo "127.0.0.1 localhost" > /etc/hosts
- echo "127.0.0.1 $HOSTNAME" >> /etc/hosts
- echo "$HOSTNAME" > /etc/hostname
- echo "Done!!!"
- sleep 1
- echo "Creating administrator user..."
- echo -n "Name: "
- read NAME
- adduser $NAME
- addgroup $NAME adm $DEBUG_N1
- addgroup $NAME cdrom $DEBUG_N1
- addgroup $NAME sudo $DEBUG_N1
- addgroup $NAME dip $DEBUG_N1
- addgroup $NAME plugdev $DEBUG_N1
- echo "Done!!!"
- sleep 1
- echo "Enabling the loopback interface..."
- echo "auto lo" >> /etc/network/interfaces
- echo "iface lo inet loopback" >> /etc/network/interfaces
- echo "" >> /etc/network/interfaces
- echo "Done!!!"
- sleep 1
- echo "Enabling DHCP on eth0..."
- echo "auto eth0" >> /etc/network/interfaces
- echo "iface eth0 inet dhcp" >> /etc/network/interfaces
- echo "" >> /etc/network/interfaces
- echo "Done!!!"
- sleep 1
- echo "Enabling static address on eth1..."
- echo "auto eth1" >> /etc/network/interfaces
- echo "iface eth1 inet static" >> /etc/network/interfaces
- echo "address 192.168.1.1" >> /etc/network/interfaces
- echo "netmask 255.255.255.0" >> /etc/network/interfaces
- echo "" >> /etc/network/interfaces
- echo "Done!!!"
- sleep 1
- echo "DON'T FORGET: You must run the POSTINSTALL.sh script located at /INSTALL!!!"
- sleep 1
- echo "If no critical erros were shown, the installation is successfully finished!"
- sleep 1
- exit
- # TO DO (as of 12/02/2014)
- # dpgk-reconfigure resolvconf (dnsmasq needs this)
Advertisement
Add Comment
Please, Sign In to add comment