forked from poppabear8883/UNIT3D-INSTALLER
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·51 lines (46 loc) · 1.51 KB
/
install.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
#!/usr/bin/env bash
source tools/colors.sh
# Detect OS
case $(head -n1 /etc/issue | cut -f 1 -d ' ') in
Ubuntu) type="ubuntu" ;;
*) type='' ;;
esac
# Unable to detect OS Properly
# Note: OVH and other providers remove the contents of /etc/issue in their OS templates
# so we need to ask the user manually to tell us what the OS is as a Fallback
# Ref: https://github.com/ServNX/UNIT3D-INSTALLER/issues/8
if [ "$type" = '' ]; then
echo -e "\n$Red We was unable to automatically determine your OS! $Color_Off"
echo -e "\n$Purple This can happen if you are using an OS template from a provider like OVH amongst others. $Color_Off\n"
PS3='Please select the # for your OS: '
options=("Ubuntu 24.04" "Ubuntu 22.04" "Ubuntu 20.04" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Ubuntu 24.04")
echo 'Ubuntu 24.04 LTS \n \l' > /etc/issue
type='ubuntu'
break
;;
"Ubuntu 22.04")
echo 'Ubuntu 22.04 LTS \n \l' > /etc/issue
type='ubuntu'
break
;;
"Ubuntu 20.04")
echo 'Ubuntu 20.04 LTS \n \l' > /etc/issue
type='ubuntu'
break
;;
"Quit")
exit 0
;;
*)
echo -e "$Red Invalid Option $REPLY $Color_Off"
;;
esac
done
fi
if [ -e $type.sh ]; then
bash ./$type.sh
fi