Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
letsencrypt.sh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
letsencrypt.sh
Commits
5060dea0
Commit
5060dea0
authored
9 years ago
by
Martin Geiseler
Committed by
Lukas Schauer
9 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check expire date of existing certs
parent
b7439a83
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
letsencrypt.sh
letsencrypt.sh
+12
-1
No files found.
letsencrypt.sh
View file @
5060dea0
...
...
@@ -184,7 +184,18 @@ if [[ "${register}" = "1" ]]; then
signed_request
"
${
CA
}
/acme/new-reg"
'{"resource": "new-reg", "agreement": "'
"
$LICENSE
"
'"}'
>
/dev/null
fi
# Generate certificates for all domains found in domain.txt
(TODO: check if certificate already exists and is about to expire)
# Generate certificates for all domains found in domain.txt
. Check if existing certificate are about to expire
<domains.txt
sed
's/^\s*//g;s/\s*$//g'
|
grep
-v
'^#'
|
grep
-v
'^$'
|
while
read
-r
line
;
do
domain
=
"
$(
echo
$line
|
cut
-d
' '
-f1
)
"
if
[[
-e
"certs/
${
domain
}
/cert.pem"
]]
;
then
echo
-n
"Found existing cert for
${
domain
}
. Expire date ..."
set
+e
;
openssl x509
-checkend
1209600
-noout
-in
"certs/
${
domain
}
/cert.pem"
;
expiring
=
$?
;
set
-e
if
[[
${
expiring
}
-eq
0
]]
;
then
echo
" is not within 2 weeks. Skipping"
continue
fi
echo
" is within 2 weeks. Renewing..."
fi
sign_domain
$line
done
This diff is collapsed.
Click to expand it.
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