-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirefox-with-proxy
More file actions
executable file
·31 lines (24 loc) · 886 Bytes
/
firefox-with-proxy
File metadata and controls
executable file
·31 lines (24 loc) · 886 Bytes
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
#!/bin/bash
# Copyright (c) 2021 by Philip Collier, github.com/AB9IL
# 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.
args="$1 $2"
BROWSER="firefox"
# For Gecko-based browsers (Firefox), use the --proxy argument.
# Get the ip and port from /tmp/session_proxy
run_proxied() {
# operate in proxied mode
${BROWSER} --proxy "$(cat /tmp/session_proxy)" --new-tab ${args} &
exit 0
}
run_clear() {
# operate without a proxy
${BROWSER} --new-tab ${args} &
exit 0
}
[ -f "/tmp/proxyflag" ] && COMMAND="run_proxied"
[ ! -f "/tmp/proxyflag" ] && COMMAND="run_clear"
$COMMAND