-
Notifications
You must be signed in to change notification settings - Fork 2
/
check-pkg.sh
executable file
·69 lines (57 loc) · 1.53 KB
/
check-pkg.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
#! /bin/bash
# 1. istall necessary packages
echo
echo " updating sysytem package list"
echo
echo
sudo apt update -y
echo
pkg_req=('x11vnc' 'adb' 'android-tools-adb' 'android-tools-fastboot')
echo " checking required packages"
check_pkg_exists(){
for package in "${pkg_req[@]}"
do
pkg_check=$(dpkg --list | grep -o "$package")
echo # newline
echo ".....checking package : $package....."
if [ "" = "${pkg_check}" ]; then
echo " Installing package please wait..."
echo
sudo apt -y install $package
echo " installed: $package"
else
echo "package already exists"
fi
done
}
check_pkg_exists
if [ -e /usr/share/X11/xorg.conf.d/20-intel.conf ]
then
echo
echo "++++++++++++++++++++++++++++++"
echo " +++++proceeding further+++++ "
echo "++++++++++++++++++++++++++++++"
echo
echo " the intel file for virtualheads exists continuing... "
echo
echo "------------------------"
echo " running setup.sh "
echo "------------------------"
else
cp 20-intel.conf /usr/share/X11/xorg.conf.d/20-intel.conf
echo
echo "[screen-extensio]"
echo "-------------You must"
echo "---------------------reboot or relogin"
echo "-------------current session"
echo "to finish setup run screen-extensio.sh "
read -p " Enter Y/n to proceed: " ans
if [ "Y" == "${ans}" ]; then
echo " ...rebooting... "
sudo reboot now
else
echo " exiting"
exit
fi
fi
echo