-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlantern-controller.sh
More file actions
60 lines (51 loc) · 1.9 KB
/
lantern-controller.sh
File metadata and controls
60 lines (51 loc) · 1.9 KB
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
#!/bin/sh
# Copyright (c) 2018 by Philip Collier, <webmaster@mofolinux.com>
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version. There is NO warranty; not even for
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Encoding=UTF-8
lanternstart(){
export http_proxy=
export https_proxy=
echo '//configure the proxy prefs
user_pref("network.proxy.ftp", "");
user_pref("network.proxy.ftp_port", 0);
user_pref("network.proxy.http", "127.0.0.1");
user_pref("network.proxy.http_port", 8118);
user_pref("network.proxy.share_proxy_settings", true);
user_pref("network.proxy.socks", "");
user_pref("network.proxy.socks_port", 0);
user_pref("network.proxy.ssl", "127.0.0.1");
user_pref("network.proxy.ssl_port", 8118);
user_pref("network.proxy.type", 1);' > /usr/local/etc/firefox/user.js
lantern -addr=127.0.0.1:8118
}
lanternstop(){
killall -9 lantern
export http_proxy=
export https_proxy=
echo '//clear the proxy prefs
user_pref("network.proxy.ftp", "");
user_pref("network.proxy.ftp_port", 0);
user_pref("network.proxy.http", "");
user_pref("network.proxy.http_port", 0);
user_pref("network.proxy.share_proxy_settings", true);
user_pref("network.proxy.socks", "");
user_pref("network.proxy.socks_port", 0);
user_pref("network.proxy.ssl", "");
user_pref("network.proxy.ssl_port", 0);
user_pref("network.proxy.type", 5);' > /usr/local/etc/firefox/user.js
exit
}
ans=$(zenity --list --title "LANTERN CONTROLLER" --width=500 --height=160 \
--text "Start and stop Lantern" \
--radiolist --column "Pick" --column "Action" \
FALSE "Start Lantern and configure Firefox settings." \
TRUE "Stop Lantern and restore Firefox settings.");
if [ "$ans" = "Start Lantern and configure Firefox settings." ]; then
lanternstart
else
lanternstop
fi