add mdmcertcheck.sh version 0.0

This commit is contained in:
Mike D'Morto 2021-02-10 19:48:00 +07:00
parent 0c5c4c4415
commit 3991ea5e1c
4 changed files with 60 additions and 3 deletions

View File

@ -1,5 +1,4 @@
tasks: dirs:
1 - insert here all used scripts 1 mdmcertcheck - scripts for check cert status
2 - write new scripts only here

2
mdmcertcheck/README.md Normal file
View File

@ -0,0 +1,2 @@
mdmcertcheck.sh - main shell script for check cert status
certlist.cfg - configuration file for cert list

View File

@ -0,0 +1,9 @@
# this is the config file for mdmcertcheck.sh
#
# a record style:
# domain = domain of the cert
# ip = ip target server for taking cert
# port = port of target server for taking cert
# cert=domain|ip|port
# expemple:
# cert=google.com|8.8.8.8|443

View File

@ -0,0 +1,47 @@
#!/bin/bash
# mdmcertcheck.sh is the script for checking a cert status
# author mikedmorto 2021 year
export LC_ALL=""
export LANG="en_US.UTF-8"
version="0.0"
CERTLIST="certlist.cfg"
JSON=""
##### PARAMETERS#####
METRIC="$1"
ITEM="$2"
case "$METRIC" in
discovery)
#records from the config file
RECS=`cat `
JSON="{ \"data\":["
# append data
# delete last simbol and add the end
JSON=${JSON::-1}
JSON=${JSON}"]}"
echo ${JSON}
exit 0
;;
script.verstion)
echo $VERSION
;;
help)
echo "please use these params
{
discovery
script.version
}"
;;
*)
echo ""
;;
esac