-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript
42 lines (37 loc) · 1011 Bytes
/
script
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
#!/bin/bash
# Checking if the script is run with bash
if readlink /proc/$$/exe | grep -q "dash"; then
echo "You need to run the script with bash instead of sh."
exit
fi
# Checking if the script is run as root
if [ "$EUID" -ne 0 ]
then echo "This script must be run as root."
exit
fi
# Checking if the operating system is Debian 10
if cat /etc/*release | grep ^VERSION_ID | grep 10; then
clear
echo "Bash script that can be used to install Java 8 on Debian 10 OS."
sleep 1
echo "Java 8 will be installed on this system in:"
echo "3 seconds"
sleep 1
echo "2 seconds"
sleep 1
echo "1 second"
sleep 1
echo "Installing Java 8 now..."
apt update
apt upgrade -y
apt install software-properties-common -y
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main'
apt update
apt install openjdk-8-jre-headless -y
echo "Java 8 should be successfully installed on your system."
java -version
exit
else
echo "You are not using Debian 10."
exit
fi