Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
292470b2
Commit
292470b2
authored
Apr 22, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add -H (--header) support
parent
d5d079f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
tools_eget
bin/tools_eget
+14
-4
No files found.
bin/tools_eget
View file @
292470b2
...
...
@@ -289,6 +289,9 @@ WGETNOSSLCHECK=''
CURLNOSSLCHECK
=
''
WGETUSERAGENT
=
''
CURLUSERAGENT
=
''
WGETHEADER
=
''
CURLHEADER
=
''
AXELHEADER
=
''
WGETCOMPRESSED
=
''
CURLCOMPRESSED
=
''
WGETQ
=
''
#-q
...
...
@@ -331,6 +334,7 @@ Options:
-q|--quiet - quiet mode
--verbose - verbose mode
-k|--no-check-certificate - skip SSL certificate chain support
-H|--header - use <header> (X-Cache:1 for example)
-U|-A|--user-agent - send browser like UserAgent
--compressed - request a compressed response and automatically decompress the content
-4|--ipv4|--inet4-only - use only IPV4
...
...
@@ -391,6 +395,12 @@ while [ -n "$1" ] ; do
WGETNOSSLCHECK
=
'--no-check-certificate'
CURLNOSSLCHECK
=
'-k'
;;
-H
|
--header
)
shift
WGETHEADER
=
"--header=
$1
"
CURLHEADER
=
"--header
$1
"
AXELHEADER
=
"--header=
$1
"
;;
-U
|
-A
|
--user-agent
)
user_agent
=
"Mozilla/5.0 (X11; Linux
$arch
) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
WGETUSERAGENT
=
"-U '
$user_agent
'"
...
...
@@ -862,9 +872,9 @@ elif [ "$EGET_BACKEND" = "wget" ] ; then
__wget
()
{
if
[
-n
"
$WGETUSERAGENT
"
]
;
then
docmd
$WGET
$FORCEIPV
$WGETQ
$WGETCOMPRESSED
$WGETNOSSLCHECK
"
$WGETUSERAGENT
"
"
$@
"
docmd
$WGET
$FORCEIPV
$WGETQ
$WGETCOMPRESSED
$WGET
HEADER
$WGET
NOSSLCHECK
"
$WGETUSERAGENT
"
"
$@
"
else
docmd
$WGET
$FORCEIPV
$WGETQ
$WGETCOMPRESSED
$WGETNOSSLCHECK
"
$@
"
docmd
$WGET
$FORCEIPV
$WGETQ
$WGETCOMPRESSED
$WGET
HEADER
$WGET
NOSSLCHECK
"
$@
"
fi
}
...
...
@@ -911,9 +921,9 @@ elif [ "$EGET_BACKEND" = "curl" ] ; then
__curl
()
{
if
[
-n
"
$CURLUSERAGENT
"
]
;
then
docmd
$CURL
$FORCEIPV
--fail
-L
$CURLQ
$CURLCOMPRESSED
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
"
$@
"
docmd
$CURL
$FORCEIPV
--fail
-L
$CURLQ
$CURLCOMPRESSED
$CURLHEADER
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
"
$@
"
else
docmd
$CURL
$FORCEIPV
--fail
-L
$CURLQ
$CURLCOMPRESSED
$CURLNOSSLCHECK
"
$@
"
docmd
$CURL
$FORCEIPV
--fail
-L
$CURLQ
$CURLCOMPRESSED
$CURL
HEADER
$CURL
NOSSLCHECK
"
$@
"
fi
}
# put remote content to stdout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment