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
7589318c
Commit
7589318c
authored
Apr 10, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: use REALURL
parent
77cd8346
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
tools_eget
bin/tools_eget
+16
-8
No files found.
bin/tools_eget
View file @
7589318c
...
...
@@ -924,9 +924,16 @@ sget()
return
fi
local
REALURL
=
"
$(
get_real_url
"
$URL
"
)
"
||
return
local
TARGET
=
"
$2
"
local
CID
=
"
$(
get_cid_by_url
"
$URL
"
)
"
if
[
-n
"
$GETREALURL
"
]
;
then
echo
"
$REALURL
"
exit
fi
local
CID
=
"
$(
get_cid_by_url
"
$REALURL
"
)
"
if
[
-n
"
$CID
"
]
;
then
if
[
-n
"
$GETFILENAME
"
]
;
then
...
...
@@ -940,12 +947,12 @@ sget()
TARGET
=
"
$CID
"
fi
fi
info
"
$
URL
->
$CID
->
$TARGET
"
[
"
$URL
"
=
"
$REALURL
"
]
&&
info
"
$URL
->
$CID
->
$TARGET
"
||
info
"
$URL
->
$REAL
URL
->
$CID
->
$TARGET
"
ipfs_get
"
$CID
"
"
$TARGET
"
return
fi
local
FN
=
"
$(
url_get_filename
"
$URL
"
)
"
||
return
local
FN
=
"
$(
url_get_filename
"
$
REAL
URL
"
)
"
||
return
if
[
-z
"
$TARGET
"
]
;
then
TARGET
=
"
$FN
"
fi
...
...
@@ -953,24 +960,25 @@ sget()
CID
=
"
$(
download_to_ipfs
"
$REALURL
"
)
"
||
return
ipfs_get
"
$CID
"
"
$TARGET
"
||
return
put_cid_and_url
"
$URL
"
"
$CID
"
"
$FN
"
put_cid_and_url
"
$
REAL
URL
"
"
$CID
"
"
$FN
"
}
check_url_is_accessible
()
{
local
URL
=
"
$1
"
local
CID
=
"
$(
get_cid_by_url
"
$URL
"
)
"
local
REALURL
=
"
$(
get_real_url
"
$URL
"
)
"
||
return
local
CID
=
"
$(
get_cid_by_url
"
$REALURL
"
)
"
if
[
-n
"
$CID
"
]
;
then
info
"
$
URL
->
$CID
"
[
"
$URL
"
=
"
$REALURL
"
]
&&
info
"
$URL
->
$CID
"
||
info
"
$URL
->
$REAL
URL
->
$CID
"
ipfs_check
"
$CID
"
return
fi
CID
=
"
$(
download_to_ipfs
"
$REALURL
"
)
"
||
return
local
FN
=
"
$(
url_get_filename
"
$REALURL
"
)
"
||
return
ipfs_cat
"
$CID
"
>
/dev/null
||
return
local
FN
=
"
$(
url_get_filename
"
$URL
"
)
"
||
return
put_cid_and_url
"
$URL
"
"
$CID
"
"
$FN
"
put_cid_and_url
"
$REALURL
"
"
$CID
"
"
$FN
"
}
get_filename
()
...
...
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