File: libproxy-tools

package info (click to toggle)
libproxy 0.5.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 728 kB
  • sloc: ansic: 3,455; sh: 228; python: 128; makefile: 37; cs: 18; perl: 6
file content (40 lines) | stat: -rwxr-xr-x 1,289 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
# Copyright 2020 Simon McVittie
# SPDX-License-Identifier: LGPL-2.1+

set -eux
set -o pipefail

#export PX_DEBUG=1

reset () {
    unset DESKTOP_SESSION
    unset FTP_PROXY
    unset GNOME_DESKTOP_SESSION_ID
    unset GSETTINGS_BACKEND
    unset HTTPS_PROXY
    unset HTTP_PROXY
    unset KDE_FULL_SESSION
    unset NO_PROXY
    unset ftp_proxy
    unset http_proxy
    unset https_proxy
    unset no_proxy
}

reset

answer="$(echo http://example.com | http_proxy=http://proxy.example.net https_proxy=http://sslproxy.example.net proxy)"
test "${answer}" = http://proxy.example.net

answer="$(http_proxy=http://proxy.example.net https_proxy=http://sslproxy.example.net proxy http://example.com)"
test "${answer}" = http://proxy.example.net

answer="$(http_proxy=http://proxy.example.net https_proxy=http://sslproxy.example.net proxy https://example.com)"
test "${answer}" = http://sslproxy.example.net

answer="$(http_proxy=http://proxy.example.net https_proxy=http://sslproxy.example.net ftp_proxy=http://ftpproxy.example.net:8000 proxy ftp://ftp.example.com)"
test "${answer}" = http://ftpproxy.example.net:8000

answer="$(http_proxy=http://proxy.example.net https_proxy=http://sslproxy.example.net no_proxy=example.com proxy http://example.com)"
test "${answer}" = direct://