-
Notifications
You must be signed in to change notification settings - Fork 2
/
dev-box.sh
executable file
·46 lines (36 loc) · 1.24 KB
/
dev-box.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
#!/bin/bash
set -x
CHECKLOGGINGUSER=$(whoami)
if [ ${CHECKLOGGINGUSER} == "root" ];
then
echo "login as sudo user to run script."
echo "You are currently logged in as root"
exit 1
fi
if [ -z $GIT_REPO ]; then
echo "GIT_REPO is not set"
export GIT_REPO="https://github.com/tosin2013/edge-anomaly-detection.git"
else
echo "GIT_REPO is set to $GIT_REPO"
fi
if cat /etc/redhat-release | grep "Red Hat Enterprise Linux release 8.[0-9]" > /dev/null 2>&1; then
echo "RHEL 8 is supported"
else
echo "RHEL 8 is not supported"
exit 1
fi
read -p "Would you like to register the system? (y/n): " register_system
if [ "$register_system" == "y" ]; then
sudo subscription-manager register
sudo subscription-manager refresh
sudo subscription-manager attach --auto
sudo subscription-manager repos --enable=rhel-8-for-x86_64-appstream-rpms --enable=rhel-8-for-x86_64-baseos-rpms
fi
sudo dnf install git vim unzip wget bind-utils tar -y
sudo dnf install ncurses-devel curl -y
curl 'https://vim-bootstrap.com/generate.vim' --data 'editor=vim&langs=javascript&langs=go&langs=html&langs=ruby&langs=python' > ~/.vimrc
if [ ! -f $HOME/edge-anomaly-detection ]; then
git clone $GIT_REPO
cd edge-anomaly-detection
./hack/setup-bastion.sh
fi