Update test.sh

This commit is contained in:
fithwum
2019-01-03 12:02:40 -08:00
parent 8fc272d55a
commit a53612d691

37
test.sh
View File

@@ -1,30 +1,13 @@
#!/bin/bash #!/bin/bash
# Copyright (c) 2018 fithwum # Copyright (c) 2018 fithwum
# All rights reserved # All rights reserved
# Setup the target partition for install
mkfs.ext4 -L Debian /dev/sda1 wget https://www.teamspeak.com/versions/server.json /mnt/user/Sync/test/server.json
mkdir /mnt/deboot TEXT="Getting latest teamspeak server version."
mount -t ext4 /dev/sda1 /mnt/deboot TS_VERSION="${TS_VERSION_CHECK}"
# Installing the base system with network access TS_VERSION_CHECK=jq .linux.x86.version server.json
debootstrap --include linux-image-amd64,grub-pc,locales --arch amd64 unstable /mnt/deboot http://ftp.us.debian.org/debian sleep 1
# Preparing the chroot environment echo "${TEXT}"
cp /etc/mtab /mnt/deboot/etc/mtab wget https://files.teamspeak-services.com/releases/server/${TS_VERSION}/teamspeak3-server_linux_amd64-${TS_VERSION}.tar.bz2 -O /mnt/user/Sync/test/ts3server_${TS_VERSION}.tar.bz2
mount -o bind /dev /mnt/deboot/dev sleep 1
mount -o bind /proc /mnt/deboot/proc exit
mount -o bind /sys /mnt/deboot/sys
# Continuing the installation within chroot
chroot /mnt/deboot /bin/bash
grub-install /dev/sda
update-grub
blkid /dev/sda1
UUID=79168060-9d9c-4cf6-8ee9-bb846aee589b / ext4 defaults,errors=remount-ro 0 1
echo "debian" > /etc/hostname
dpkg-reconfigure locales
passwd
adduser user
# Setting up the network (eth0)
dhclient -v eth0
# Finishing the install
apt-get clean
update-initramfs -u -k all
exit