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
95db5a19
Commit
95db5a19
authored
Apr 06, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add --no-check-certificate support
parent
4b2ce66f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
tools_eget
bin/tools_eget
+15
-6
No files found.
bin/tools_eget
View file @
95db5a19
...
...
@@ -103,6 +103,8 @@ docmd()
check_tty
WGETNOSSLCHECK
=
''
CURLNOSSLCHECK
=
''
WGETQ
=
''
#-q
CURLQ
=
''
#-s
WGETOPTIONS
=
'--content-disposition'
...
...
@@ -120,6 +122,12 @@ if [ "$1" = "-q" ] ; then
shift
fi
if
[
"
$1
"
=
"-k"
]
||
[
"
$1
"
=
"--no-check-certificate"
]
;
then
WGETNOSSLCHECK
=
'--no-check-certificate'
CURLNOSSLCHECK
=
'-k'
shift
fi
WGET
=
"
$(
which wget 2>/dev/null
)
"
...
...
@@ -127,19 +135,19 @@ if [ -n "$WGET" ] ; then
# put remote content to stdout
scat
()
{
docmd
$WGET
$WGETQ
-O-
"
$1
"
docmd
$WGET
$WGETQ
$WGETNOSSLCHECK
-O-
"
$1
"
}
# download to default name of to $2
sget
()
{
if
[
-n
"
$2
"
]
;
then
docmd
$WGET
$WGETQ
$WGETOPTIONS
-O
"
$2
"
"
$1
"
docmd
$WGET
$WGETQ
$WGET
NOSSLCHECK
$WGET
OPTIONS
-O
"
$2
"
"
$1
"
else
# TODO: поддержка rsync для известных хостов?
# Не качать, если одинаковый размер и дата
# -nc
# TODO: overwrite always
docmd
$WGET
$WGETQ
$WGETOPTIONS
"
$1
"
docmd
$WGET
$WGETQ
$WGET
NOSSLCHECK
$WGET
OPTIONS
"
$1
"
fi
}
...
...
@@ -149,15 +157,15 @@ CURL="$(which curl 2>/dev/null)"
# put remote content to stdout
scat
()
{
$CURL
-L
$CURLQ
"
$1
"
$CURL
-L
$CURLQ
$CURLNOSSLCHECK
"
$1
"
}
# download to default name of to $2
sget
()
{
if
[
-n
"
$2
"
]
;
then
docmd
$CURL
-L
$CURLQ
$CURLOPTIONS
--output
"
$2
"
"
$1
"
docmd
$CURL
-L
$CURLQ
$CURL
NOSSLCHECK
$CURL
OPTIONS
--output
"
$2
"
"
$1
"
else
docmd
$CURL
-L
$CURLQ
$CURLOPTIONS
-O
"
$1
"
docmd
$CURL
-L
$CURLQ
$CURL
NOSSLCHECK
$CURL
OPTIONS
-O
"
$1
"
fi
}
fi
...
...
@@ -216,6 +224,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then
echo
echo
"Options:"
echo
" -q - quiet mode"
echo
" -k|--no-check-certificate - skip SSL certificate chain support"
echo
" -O file - download to this file (use filename from server if missed)"
echo
" --list - print files from url with mask"
echo
" --latest - print only latest version of file"
...
...
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