Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
R
routeros-scripts
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christian Hesse
routeros-scripts
Commits
beb2e700
Commit
beb2e700
authored
Jul 17, 2019
by
Christian Hesse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check-certificates: use $ParseKeyValueStore
parent
047c0989
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
check-certificates
check-certificates
+3
-11
No files found.
check-certificates
View file @
beb2e700
...
...
@@ -8,19 +8,11 @@
:global CertRenewUrl;
:global CertRenewPass;
:global ParseKeyValueStore;
:global SendNotification;
:global UrlEncode;
:global WaitForFile;
:local GetIssuerCN do={
:foreach IssuerI in=$1 do={
:if ([ :pick $IssuerI 0 3 ] = "CN=") do={
:return [ :pick $IssuerI 3 99 ];
}
}
:return "";
}
:local FormatExpire do={
:global CharacterReplace;
:return [ $CharacterReplace [ $CharacterReplace [ :tostr $1 ] "w" "w " ] "d" "d " ];
...
...
@@ -76,7 +68,7 @@
"Name: " . ($CertVal->"name") . "\n" . \
"CommonName: " . ($CertNewVal->"common-name") . "\n" . \
"Fingerprint: " . ($CertNewVal->"fingerprint") . "\n" . \
"Issuer: " .
[ $GetIssuerCN ($CertNewVal->"issuer") ]
. "\n" . \
"Issuer: " .
([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN")
. "\n" . \
"Validity: " . ($CertNewVal->"invalid-before") . " to " . ($CertNewVal->"invalid-after") . "\n" . \
"Expires in: " . [ $FormatExpire ($CertNewVal->"expires-after") ]);
:log info ("The certificate " . ($CertVal->"name") . " has been renewed.");
...
...
@@ -100,7 +92,7 @@
"Name: " . ($CertVal->"name") . "\n" . \
"CommonName: " . ($CertVal->"common-name") . "\n" . \
"Fingerprint: " . ($CertVal->"fingerprint") . "\n" . \
"Issuer: " . ($CertVal->"ca") .
[ $GetIssuerCN ($CertVal->"issuer") ]
. "\n" . \
"Issuer: " . ($CertVal->"ca") .
([ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN")
. "\n" . \
"Validity: " . ($CertVal->"invalid-before") . " to " . ($CertVal->"invalid-after") . "\n" . \
"Expires in: " . $ExpiresAfter);
:log warning ("The certificate " . ($CertVal->"name") . " " . $State . \
...
...
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