-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquickstart.sh
executable file
·56 lines (45 loc) · 1.56 KB
/
quickstart.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
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo verifying user...
if [[ "${EUID}" != 0 ]] ; then
echo "Must run as root."
exit 1
fi
if [[ ! -f "/home/alarm/quickstart.sh" ]]; then # not currently booted into pi
echo this is only intended to be used in conjunction with the arclinux.sh install script! would you like to install archlinux on an sd card now? [Y/n]
read SHOULD_INSTALL_ARCH_LINUX
if [[ $SHOULD_INSTALL_ARCH_LINUX == 'n' ]]; then
echo "nothing to do!"
exit 0
else
bash $SCRIPT_DIR/installs/archlinux.sh
exit 0
fi
fi
echo what would you like to name this machine?
read HOSTNAME
hostnamectl set-hostname $HOSTNAME
echo setting global options...
sed -i 's/\#Color/Color\nILoveCandy\nTotalDownload/g' /etc/pacman.conf
echo updating and installing programs with pacman...
bash $SCRIPT_DIR/installs/pacman.sh
echo installing user profile...
echo what would you like to name your user?
read USERNAME
export USERNAME
bash $SCRIPT_DIR/installs/userprofile.sh
echo installing packages from the aur...
bash $SCRIPT_DIR/installs/aur.sh
echo installing kubetools...
cd /opt
git clone https://github.com/pi-netes/kubetools.git
ln -s /opt/kubetools/kubetools.sh /usr/local/bin/kubetools
sed -i 's/SCRIPT_DIR=.*/SCRIPT_DIR=\/opt\/kubetools/' /opt/kubetools/kubetools.sh
echo cloning deployments...
cd /home/$USERNAME
git clone https://github.com/pi-netes/deployments.git
chown -R j:users deployments
echo provisioning cluster...
sudo -u $USERNAME kubetools
echo "to clean up, please run:
rm -rf /home/alarm
userdel alarm"