forked from himanshub16/ProxyMan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy_check.sh
executable file
·76 lines (66 loc) · 1.67 KB
/
proxy_check.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
#!/bin/bash
if [ -e "$HOME/.bashrc" ]; then
a=$(grep -i proxy $HOME/.bashrc | wc -l)
if [ a -eq 0 ]; then
echo ".bashrc is not using proxy."
else
echo "For ~/.bashrc..."
grep -i proxy $HOME/.bashrc
fi
else
echo ".bashrc does not exist."
fi
echo
if [ -e "/etc/environment" ]; then
a=$(grep -i proxy /etc/environment | wc -l)
if [ a -eq 0 ]; then
echo "/etc/environment is not using proxy."
else
echo "For /etc/environment"
grep -i proxy /etc/environment
fi
else
echo "/etc/environment does not exist."
fi
echo
if [ -e "$HOME/.bash_profile" ]; then
a=$(grep -i proxy $HOME/.bash_profile | wc -l)
if [ a -eq 0 ]; then
echo ".bash_profile is not using proxy."
else
echo "For ~/.bash_profile..."
grep -i proxy $HOME/.bash_profile
fi
else
echo ".bash_profile does not exist."
fi
echo
if [ -e "/etc/apt/apt.conf" ]; then
echo "This is apt.conf ..."
cat "/etc/apt/apt.conf"
else
echo "apt is not using proxy."
fi
echo
gsettingsavailable="$(which gsettings)"
if [ $gsettingsavailable != '' ]; then
mode=$(gsettings get org.gnome.system.proxy mode)
if [ $mode == "'none'" ]; then
echo "The desktop environment is not using any proxy settings."
echo "Thus, gsettings configurations are ineffective."
elif [ $mode == "'manual'" ]; then
echo "The desktop environment is using manual proxy settings."
echo "Thus, following gsettings configurations are effective."
gsettings list-recursively org.gnome.system.proxy
else
echo "We cannot determine the type of settings. Sorry :("
fi
fi
echo
npmavailable="$(which npm)"
if [ $npmavailable != '' ]; then
echo -n "npm http proxy: "
npm config get proxy
echo -n "npm https proxy: "
npm config get https-proxy
fi