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
Nurlan
eepm
Commits
ac659635
Commit
ac659635
authored
Apr 08, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: workaround quotes
parent
cfe43f0d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
tools_eget
bin/tools_eget
+25
-9
No files found.
bin/tools_eget
View file @
ac659635
...
...
@@ -133,9 +133,9 @@ if [ "$1" = "-k" ] || [ "$1" = "--no-check-certificate" ] ; then
fi
if
[
"
$1
"
=
"-U"
]
||
[
"
$1
"
=
"-A"
]
||
[
"
$1
"
=
"--user-agent"
]
;
then
user_agent
=
"
'Mozilla/5.0 (X11; Linux
$arch
)'
"
WGETUSERAGENT
=
"-U
$user_agent
"
CURLUSERAGENT
=
"-A
$user_agent
"
user_agent
=
"
Mozilla/5.0 (X11; Linux
$arch
)
"
WGETUSERAGENT
=
"-U
'
$user_agent
'
"
CURLUSERAGENT
=
"-A
'
$user_agent
'
"
shift
fi
...
...
@@ -143,40 +143,56 @@ fi
WGET
=
"
$(
which wget 2>/dev/null
)
"
if
[
-n
"
$WGET
"
]
;
then
__wget
()
{
if
[
-n
"
$WGETUSERAGENT
"
]
;
then
docmd
$WGET
$WGETQ
$WGETNOSSLCHECK
"
$WGETUSERAGENT
"
"
$@
"
else
docmd
$WGET
$WGETQ
$WGETNOSSLCHECK
"
$@
"
fi
}
# put remote content to stdout
scat
()
{
docmd
$WGET
$WGETQ
"
$WGETUSERAGENT
"
$WGETNOSSLCHECK
-O-
"
$1
"
__wget
$WGETNOSSLCHECK
-O-
"
$1
"
}
# download to default name of to $2
sget
()
{
if
[
-n
"
$2
"
]
;
then
docmd
$WGET
$WGETQ
"
$WGETUSERAGENT
"
$WGETNOSSLCHECK
$WGETOPTIONS
-O
"
$2
"
"
$1
"
docmd
__wget
$WGETOPTIONS
-O
"
$2
"
"
$1
"
else
# TODO: поддержка rsync для известных хостов?
# Не качать, если одинаковый размер и дата
# -nc
# TODO: overwrite always
docmd
$WGET
$WGETQ
"
$WGETUSERAGENT
"
$WGETNOSSLCHECK
$WGETOPTIONS
"
$1
"
docmd
__wget
$WGETOPTIONS
"
$1
"
fi
}
else
CURL
=
"
$(
which curl 2>/dev/null
)
"
[
-n
"
$CURL
"
]
||
fatal
"There are no wget nor curl in the system. Install it with
$
epm install curl"
__curl
()
{
if
[
-n
"
$CURLUSERAGENT
"
]
;
then
docmd
$CURL
-L
$CURLQ
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
"
$@
"
else
docmd
$CURL
-L
$CURLQ
$CURLNOSSLCHECK
"
$@
"
fi
}
# put remote content to stdout
scat
()
{
$CURL
-L
$CURLQ
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
"
$1
"
__curl
"
$1
"
}
# download to default name of to $2
sget
()
{
if
[
-n
"
$2
"
]
;
then
docmd
$CURL
-L
$CURLQ
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
$CURLOPTIONS
--output
"
$2
"
"
$1
"
__curl
$CURLOPTIONS
--output
"
$2
"
"
$1
"
else
docmd
$CURL
-L
$CURLQ
"
$CURLUSERAGENT
"
$CURLNOSSLCHECK
$CURLOPTIONS
-O
"
$1
"
__curl
$CURLOPTIONS
-O
"
$1
"
fi
}
fi
...
...
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