forked from iiab/iiab-factory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
curl-me.unused
83 lines (63 loc) · 2.04 KB
/
curl-me.unused
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
#!/bin/bash -x
# Start loading IIAB. "bash -x" is debug mode
set -e
# "set -e" to exit on error (avoids snowballing)
LSB_RELEASE=`which lsb_release`
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"
else
LINUX_DIST = "Unknown"
fi
fi
if [ $LINUX_DIST == "Centos" ]; then
yum update
# in case needed
yum install -y git
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 install -y git
else
echo "$LINUX_DIST not supported at this time."
exit 1
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
./scripts/ansible
# Installs the correct version of Ansible
cd /opt/iiab/iiab/vars
if [ $LINUX_DIST == "Raspbian" ]; then
wget http://download.iiab.io/6.3/rpi/local_vars.yml
# Above assumes a virgin RPi system (wget WON'T overwrite existing files)
fi
# In general please examine local_vars.yml carefully (and modify as nec)
# before running Ansible (below, which takes ~2.5 hours the first time!)
# And note the security warning
# NOTE: you can change many/most settings after install too, using the
# Admin Console (http://box/admin) as documented at: http://FAQ.IIAB.IO
read -p "Press enter to Install or ctl-c to STOP and edit local vars"
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