-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcurl-me
84 lines (69 loc) · 2.1 KB
/
curl-me
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
#!/bin/bash -x
# Original shell script from https://github.com/iiab/iiab-factory/blob/master/curl-me
# Start loading IIAB. "bash -x" is debug mode
set -e
# "set -e" to exit on error (avoids snowballing)
# Checks if lsb_release is available on the system
if [ -x lsb_release ]; then
LSB_RELEASE=`which lsb_release`
else
echo "The 'lsb_release' program is missing."
fi
if [ "$LSB_RELEASEx" != "x" ]; then
LINUX_DIST=`lsb_release -is`
else
if [ -f /etc/debian_version ]; then
# assume Raspbian has lsb_release
LINUX_DIST = "Debian"
elif [ -f /etc/centos_version ]; then
LINUX_DIST = "CentOS"
elif [ -f /etc/redhat-release ]; then
LINUX_DIST = "Fedora"
else
LINUX_DIST = "Unknown"
fi
fi
if [ $LINUX_DIST == "CentOS" ]; then
yum -y update
# in case needed
yum install -y git wget
elif [ $LINUX_DIST == "Fedora" ]; then
dnf -y update
dnf -y install git wget
elif [ $LINUX_DIST == "Ubuntu" ] || [ $LINUX_DIST == "Debian" ] || [ $LINUX_DIST == "Raspbian" ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
apt-get -y dist-upgrade
apt-get -y clean
# in case needed
apt-get -y install git wget
else
echo "$LINUX_DIST not supported at this time."
exit 1
fi
# Clean up old repositories
if [ -d /opt/iiab ]; then rm -Rf /opt/iiab; fi
mkdir -p /opt/iiab
# Get the extras
cd /opt/iiab
git clone https://github.com/iiab/iiab-factory --depth 1
# Get the current install options (we'll do more with these later like manage releases)
source /opt/iiab/iiab-factory/factory-settings
git clone https://github.com/iiab/iiab-admin-console --depth 1
git clone https://github.com/iiab/iiab-menu --depth 1
# Get iiab
git clone https://github.com/iiab/iiab --depth 1
cd /opt/iiab/iiab/vars
#wget http://download.iiab.io/6.4/rpi/local_vars_min.yml
#ln -sf local_vars_big.yml local_vars.yml
wget http://download.iiab.io/6.4/rpi/local_vars_min.yml
ln -sf local_vars_min.yml local_vars.yml
cd /opt/iiab/iiab/scripts
./ansible
cd /opt/iiab/iiab
./runansible
# Try to rerun the above line if it fails?
cd /opt/iiab/iiab-admin-console
./install
cd /opt/iiab/iiab-menu
./cp-menus