Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Downloader
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
Geant DevOps
Acme Downloader
Commits
f9120c13
Unverified
Commit
f9120c13
authored
3 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
fix exit status
parent
2851507e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#29563
passed
3 years ago
Stage: sonarqube
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
acme-downloader.sh
+8
-5
8 additions, 5 deletions
acme-downloader.sh
with
8 additions
and
5 deletions
acme-downloader.sh
+
8
−
5
View file @
f9120c13
...
...
@@ -28,23 +28,26 @@ stty -echoctl # hide ^C
# function called by trap
clean_up
()
{
rm
-f
$TMP_CERT
$TMP_FULLCHAIN
$TMP_CA
$TMP_KEY
exit
$1
if
[
"$#"
-eq
1
]
;
then
exit
$1
fi
exit
}
trap
'clean_up'
SIGINT
if
[
$(
id
-u
)
-ne
0
]
;
then
echo
-e
"plase run this script as root
\n
giving up..."
clean_up
clean_up
2
elif
!
which curl jq &>/dev/null
;
then
echo
-e
"please install curl and jq
\n
giving up..."
clean_up
clean_up
2
fi
# lsb_release is not always installed
if
!
source
/etc/os-release &>/dev/null
;
then
echo
"no idea what to do with this OS: I was not able to access /etc/os-release"
echo
""
clean_up
clean_up
2
elif
[[
"
$ID
"
==
"ubuntu"
]]
||
[[
"
$ID
"
==
"debian"
]]
||
[[
"
$ID
"
==
"arch"
*
]]
;
then
CERT_BASE
=
"/etc/ssl/certs"
KEY_BASE
=
"/etc/ssl/private"
...
...
@@ -57,7 +60,7 @@ else
echo
"no idea what to do with OS:
$ID
"
echo
"please amend the script accordingly"
echo
""
clean_up
clean_up
2
fi
usage
()
{
...
...
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