-
Notifications
You must be signed in to change notification settings - Fork 0
/
drivers.sh
89 lines (67 loc) · 1.91 KB
/
drivers.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
#!/bin/bash
# Set Color
RED="\e[31m"
GREEN="\e[32m"
BLUE="\e[34m"
ENDCOLOR="\e[0m"
# For root control
if [ "$(id -u)" != 0 ]; then
printf "${RED}"
cat <<EOL
========================================================================
You are not root! This script must be run as root!
========================================================================
EOL
printf "${ENDCOLOR}"
exit 1
fi
# Get USER name
USER=$(logname)
# Get HOME folder path
HOME=/home/$USER
# Go TEMP folder
cd /tmp
# Update
printf "\n${BLUE}========================Installing Updating========================${ENDCOLOR}\n"
apt-get -y update
printf "${GREEN}========================Updated successfully!========================${ENDCOLOR}\n"
# Upgrade
printf "\n${BLUE}===========================Upgrading===========================${ENDCOLOR}\n"
apt-get -y upgrade
printf "${GREEN}==========================Upgraded successfully!===========================${ENDCOLOR}\n"
# Install driver
declare -A driver
drivers=(
bluez
bluez-utils
blueman
)
systemctl start bluetooth.service
systemctl enable bluetooth.service
printf "\n${BLUE}========================Installing drivers $1========================${ENDCOLOR}\n"
for key in "${drivers[@]}"; do
sudo pacman -S $key
done
printf "\n${BLUE}===============Drivers are installed successfully=============== ${ENDCOLOR}\n"
# Install NVIDIA Driver
#pacman -S nvidia
#pacman -S nvidia-settings
# Bluetooth visible off
hciconfig hci0 noscan
printf "\n${GREEN}"
cat <<EOL
===========================================================================
Congratulations, everything you wanted to install is installed!
===========================================================================
EOL
printf "${ENDCOLOR}\n"
cat <<EOL
EOL
printf ${RED}
read -p "Are you going to reboot this machine for stability? (y/n): " -n 1 answer
if [[ $answer =~ ^[Yy]$ ]]; then
reboot
fi
printf ${ENDCOLOR}
cat <<EOL
EOL