-
Notifications
You must be signed in to change notification settings - Fork 2
/
add_Ubuntu_Family.sh
148 lines (129 loc) · 6.56 KB
/
add_Ubuntu_Family.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/bash
echo "This script will install x64 versions of the following operating systems.
Edubuntu - A complete Linux based operating system targeted for primary and secondary education. It is freely available with community based support. The Edubuntu community is built on the ideas enshrined in the Edubuntu Manifesto: that software, especially for education, should be available free of charge and that software tools should be usable by people in their local language and despite any disabilities.
Net Installer
Ubuntu Desktop
Ubuntu Server - An official derivative made for use in servers. Ubuntu Server handles mail, controls printers, acts as a fileserver, can host LAMP and more.
Lubuntu - Lubuntu is a project that is an official derivative of the Ubuntu operating system that is lighter, less resource hungry and more energy-efficient, using the LXDE desktop environment.
Xubuntu - An official derivative of Ubuntu using Xfce. Xubuntu is intended for use on less-powerful computers or those who seek a highly efficient desktop environment on faster systems, and uses mostly GTK+ applications.
Mythbuntu - Based on Ubuntu and MythTV, providing applications for recording TV and acting as a media center.
Ubuntu Studio - Based on Ubuntu, providing open-source applications for multimedia creation aimed at the audio, video and graphic editors. "
cd ~/Downloads
wget http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso
http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso
http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/installer-amd64/current/images/netboot/netboot.tar.gz
http://cdimage.ubuntu.com/edubuntu/releases/14.04.5/release/edubuntu-14.04.5-dvd-i386.iso
http://cdimage.ubuntu.com/lubuntu/xenial/daily/current/xenial-alternate-amd64.iso
http://cdimage.ubuntu.com/mythbuntu/xenial/daily-live/current/xenial-desktop-amd64.iso
http://cdimage.ubuntu.com/ubuntustudio/xenial/dvd/current/xenial-dvd-amd64.iso
ubuntu_array=(
http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-desktop-amd64.iso
http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso
)
# echo "Please select :
# 1.ISO
# 2.Torrent ( not working )"
# read method
# if [ method == 1 ]; then
# echo "Downloading ISOs"
# fi
# " >> /var/lib/tftpboot/pxelinux.cfg/pxe.conf
echo " MENU BEGIN Ubuntu" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU TITLE Ubuntu" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " LABEL Previous" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU LABEL Previous Menu" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " TEXT HELP" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " Return to previous menu" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " ENDTEXT" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU EXIT" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU SEPARATOR" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU INCLUDE Ubuntu/Ubuntu.menu" >> /var/lib/tftpboot/pxelinux.cfg/default
echo " MENU END" >> /var/lib/tftpboot/pxelinux.cfg/default
sudo mkdir /var/lib/tftpboot/Ubuntu
sudo touch /var/lib/tftpboot/Ubuntu/Ubuntu.menu
for x in ${ubuntu_array[@]}; do
# echo $x
y=$(echo $x | cut -d / -f 5)
z=$(echo $y | sed "s/.iso//g")
# echo $y
echo ""
if [ ! -f ~/Downloads/$y ]; then
echo "~/$y NOT found, attempting to download."
echo "--Downloading $y LTS..."
cd ~/Downloads
wget $x
else
echo "$y found."
fi
if [ ! -d /var/lib/tftpboot/Ubuntu/$z ]; then
sudo mkdir /var/lib/tftpboot/Ubuntu/$z; fi
sudo mount -o loop -t iso9660 ~/Downloads/$y /mnt/loop
sudo cp /mnt/loop/casper/vmlinuz /var/lib/tftpboot/Ubuntu/$z
sudo cp /mnt/loop/install/vmlinuz.efi /var/lib/tftpboot/Ubuntu/$z
sudo cp /mnt/loop/casper/initrd.lz /var/lib/tftpboot/Ubuntu/$z
sudo cp /mnt/loop/install/initrd.gz /var/lib/tftpboot/Ubuntu/$z
sudo mkdir -p /srv/install/Ubuntu/$z
sudo cp -R /mnt/loop/* /srv/install/Ubuntu/$z
sudo cp -R /mnt/loop/.disk /srv/install/Ubuntu/$z
sudo umount /mnt/loop
done
#
# for x in ${ubuntu_net_array[@]}; do
# echo $x
# y=$(echo "net_installer_"; echo $x | cut -d / -f 8)
# echo $y
# echo ""
# if [ ! -f ~/Downloads/$y ]; then
# echo "ubuntu/$y NOT found, attempting to download."
# echo "--Downloading $y LTS..."
# cd ~/Downloads
# wget $x
# else
# echo "$y found."
# if [ ! - d /var/lib/tftpboot/ubuntu-14.04.3-desktop-i386 ]; then
# sudo mkdir /var/lib/tftpboot/ubuntu-14.04.3-desktop-i386; fi
# sudo mount -o loop -t iso9660 ~/Downloads/ubuntu-14.04.3-desktop-i386.iso /mnt/loop
# sudo cp /mnt/loop/casper/vmlinuz /var/lib/tftpboot/ubuntu-14.04.3-desktop-i386
# sudo cp /mnt/loop/casper/initrd.lz /var/lib/tftpboot/ubuntu-14.04.3-desktop-i3863
# sudo mkdir -p /srv/install/ubuntu-14.04.3-desktop-i386
# sudo cp -R /mnt/loop/* /srv/install/ubuntu-14.04.3-desktop-i386
# sudo cp -R /mnt/loop/.disk /srv/install/ubuntu-14.04.3-desktop-i386
# sudo umount /mnt/loop
# fi
#done
for x in ${iso_array[@]}; do
# echo $x
y=$(echo $x | cut -d / -f 8)
z=$(echo $y | sed "s/.iso//g")
# echo $y
# echo $z
echo ""
if [ ! -f ~/Downloads/$y ]; then
echo "~/Downloads/$y NOT found, attempting to download."
echo "--Downloading $y LTS..."
cd ~/Downloads
wget $x
else
echo "$y found."
fi
if [ ! -d /var/lib/tftpboot/Ubuntu/$z ]; then
sudo mkdir -v "/var/lib/tftpboot/Ubuntu/$z"
sudo mount -o loop -t iso9660 ~/Downloads/$y /mnt/loop
sudo cp /mnt/loop/casper/vmlinuz "/var/lib/tftpboot/Ubuntu/$z"
sudo cp /mnt/loop/casper/vmlinuz.efi "/var/lib/tftpboot/Ubuntu/$z"
sudo cp /mnt/loop/casper/initrd.lz "/var/lib/tftpboot/Ubuntu/$z"
if [ ! -d /srv/install/$z ]; then
sudo mkdir -p -v /srv/install/$z
sudo cp -R -v /mnt/loop/* /srv/install/$z
sudo cp -R -v /mnt/loop/.disk /srv/install/$z
fi
sudo umount /mnt/loop
echo "LABEL" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " MENU LABEL $z" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " KERNEL Ubuntu/$z/vmlinuz.efi" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " APPEND boot=casper netboot=nfs nfsroot=10.10.1.10:/srv/install/Ubuntu/$z initrd=Ubuntu/$z/initrd.lz" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " TEXT HELP" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " Boot the $z" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
echo " ENDTEXT" >> /var/lib/tftpboot/Ubuntu/Ubuntu.menu
fi
done