Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TSA NG
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Renzo Mauro Ontivero
TSA NG
Commits
f7758553
Commit
f7758553
authored
5 years ago
by
Robert Martin-Legene
Browse files
Options
Downloads
Patches
Plain Diff
Un script para demonstrar como llamar al API
parent
95421d85
No related branches found
Branches containing commit
Tags
v1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/tsa2.sh
+44
-0
44 additions, 0 deletions
bin/tsa2.sh
with
44 additions
and
0 deletions
bin/tsa2.sh
0 → 100755
+
44
−
0
View file @
f7758553
#!/bin/bash
# Robert Martin-Legene <robert@nic.ar>
# Copyright 2019, NIC Argentina
# License: GPLv2-only
TSAHOST
=
${
TSAHOST
:-
localhost
}
TSAPORT
=
${
TSAPORT
:-
3000
}
function
usage
{
echo
"Usage:
`
basename
$0
`
{stamp|verify} <sha256>"
>
&2
exit
1
;
}
op
=
$1
hash
=
$2
out
=
$(
mktemp
)
trap
"rm -f
$out
"
EXIT
test
${#
hash
}
=
64
||
usage
case
"
$op
"
in
stamp
)
curl
--header
'Content-Type: application/json'
--data
"{
\"
hashes
\"
:[
\"
${
hash
}
\"
]}"
http://
${
TSAHOST
}
:
${
TSAPORT
}
/stamp
echo
;;
verify
)
curl
--silent
http://
${
TSAHOST
}
:
${
TSAPORT
}
/verify/
${
hash
}
>
$out
rc
=
$?
if
[
$rc
!=
0
]
then
echo
"curl failed and returned exit code
$rc
."
>
&2
exit
$rc
fi
if
which jq
>
/dev/null
then
jq
.
<
$out
else
cat
$out
fi
;;
*
)
usage
esac
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment