add mdmcertcheck.sh version 0.0
This commit is contained in:
parent
0c5c4c4415
commit
3991ea5e1c
@ -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
2
mdmcertcheck/README.md
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
mdmcertcheck.sh - main shell script for check cert status
|
||||||
|
certlist.cfg - configuration file for cert list
|
||||||
9
mdmcertcheck/certlist.cfg
Normal file
9
mdmcertcheck/certlist.cfg
Normal 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
|
||||||
47
mdmcertcheck/mdmcertcheck.sh
Normal file
47
mdmcertcheck/mdmcertcheck.sh
Normal 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
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user