-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
ibrainit.sh
executable file
·126 lines (109 loc) · 3.04 KB
/
ibrainit.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
#!/bin/bash
######################################################################
# Title : Beachhead - Initial Installer for IBRAMENU
# By : DiscDuck, Taos15
# License : General Public License GPL-3.0-or-later
# Another fine product brought to you by IBRACORP™
######################################################################
# IBRACORP logo
ibralogo () {
tput clear
tput bold
tput setaf 1
tee <<-EOF
___ ____ ____ _ ____ ___ ____ ____ ™
|_ _| __ )| _ \ / \ / ___/ _ \| _ \| _ \
| || _ \| |_) | / _ \| | | | | | |_) | |_) |
| || |_) | _ < / ___ \ |__| |_| | _ <| __/
|___|____/|_| \_\/_/ \_\____\___/|_| \_\_|
IBRAINSTALL - Installer for IBRAMENU
Become a Member and sponsor us: https://ibracorp.io/memberships
EOF
tput sgr0
}
disclaimer () {
ibralogo
tee <<-EOF
Thank you for installing IBRAMENU!
Please take a moment and read our IBRACORP Disclaimer:
https://docs.ibracorp.io/ibracorp/
EOF
read -p "Press Enter to continue"
}
# Checklist
checklist () {
ibralogo
tee <<-EOF
Your System:
CPU Threads: $(lscpu | grep "CPU(s):" | tail +1 | head -1 | awk '{print $2}')
IP: $(hostname -I | awk '{print $1}')
RAM: $(free -m | grep Mem | awk 'NR=1 {print $2}') MB
EOF
# Check linux distribution
if [ -f /etc/os-release ]; then
. /etc/os-release
dist=$NAME
release=$VERSION_ID
elif type lsb_release >/dev/null 2>&1; then
dist=$(lsb_release -si)
release=$(lsb_release -sr)
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
dist=$DISTRIB_ID
release=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
dist=Debian
release=$(cat /etc/debian_version)
else
dist=$(uname -s)
release=$(uname -r)
fi
distribution="$dist $release"
case $distribution in
"Ubuntu 18.04" | "Ubuntu 20.04" | "Ubuntu 22.04" | "Ubuntu 22.10")
echo "$distribution has been tested and works"
echo
sleep 3
;;
"Debian GNU/Linux 10")
echo "$distribution is considered experimental but will mostly work"
echo "You will be asked if you want to switch the debian repositories from 'stable' to 'oldstable'. More info can be found here: https://wiki.debian.org/DebianOldStable"
read -p "Press Enter to continue"
;;
"Debian GNU/Linux 11")
echo "$distribution is considered experimental but will mostly work"
read -p "Press Enter to continue"
;;
*)
read -p "$distribution has not been tested, would you like to continue? (y/n) " accept
case "$accept" in
[yY])
;;
*)
exit 0
;;
esac
;;
esac
}
# Launch IBRAINSTALL
install () {
mkdir -p /opt/ibracorp
wget -qO /opt/ibracorp/ibrainstall.sh https://raw.githubusercontent.com/ibracorp/ibramenu/main/ibrainstall.sh
chmod +x /opt/ibracorp/ibrainstall.sh
/opt/ibracorp/ibrainstall.sh $1
}
# Execute
if [ -z $1 ]
then
disclaimer
fi
if [ -n $2 ]
then
mkdir -p /opt/ibracorp
echo $2 > /opt/ibracorp/token
fi
checklist
install $1
# cleanup the initial ibrainstall
rm /opt/ibracorp/ibrainstall.sh