-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure
executable file
·52 lines (45 loc) · 1011 Bytes
/
configure
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
#!/bin/bash
RED='\e[31m'
GREEN='\e[32m'
CYAN='\e[36m'
ENDCOLOR="\e[0m"
set -o nounset
if [[ -t 1 ]]
then
tty_escape() { printf "\033[%sm" "$1"; }
else
tty_escape() { :; }
fi
UNDERLINE="$(tty_escape "4;39")"
#
# Checking for dependencies...
#
msgs=()
echo -n "checking for xterm... "
if type -t xterm >/dev/null; then
echo "found"
else
echo "not found"
msgs+=("xterm not found")
fi
echo -n "checking for nmcli... "
if type -t nmcli >/dev/null; then
echo "found"
else
echo "not found"
msgs+=("nmcli not found")
fi
#
# Report the results...
#
if [[ ${#msgs[*]} == 0 ]]; then
echo -e $GREEN "\nPassed all the Dependecy checks" $ENDCOLOR
exit 0
fi
echo -e $GREEN "\n** Ooops, one of many bad things happened:" $ENDCOLOR
for msg in "${msgs[@]}"; do
echo -e $RED " - ${msg}" $ENDCOLOR
done
echo -ne $GREEN "\nFollow the link to install the dependencies:" $ENDCOLOR
echo -e $UNDERLINE"https://github.com/TanmayPatil105/wifi-cli#dependencies\n" $ENDCOLOR
exit 1