From 5b1ce468d7e19d48a90c4fa3a98e45a613fa2b9b Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 2 Jul 2023 23:31:03 +0300 Subject: [PATCH] ... Signed-off-by: Alex A. Naanou --- .pct-helpers | 4 +++- check-status | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.pct-helpers b/.pct-helpers index 1560105..a64b611 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -5,6 +5,7 @@ CT_DIR=${CT_DIR:=/etc/pve/lxc/} #---------------------------------------------------------------------- + #QUIET= #DRY_RUN= @(){ @@ -19,7 +20,8 @@ CT_DIR=${CT_DIR:=/etc/pve/lxc/} #---------------------------------------------------------------------- -# get CT hostname... +# CT hostname <-> id... + ct2hostname(){ local ct=${CT_DIR}/${1}.conf local host=$(cat $ct | grep hostname | head -1) diff --git a/check-status b/check-status index 5136583..477e577 100644 --- a/check-status +++ b/check-status @@ -12,6 +12,37 @@ HTTP_OK_STATUS=${HTTP_OK_STATUS:='2[0-9][0-9]|30[1-9]|401|501'} +#---------------------------------------------------------------------- +# Help... + +case $1 in + -h|--help) + echo "Do a status check on URL(s)." + echo + echo "Suage:" + echo " `basename $0` URL ..." + echo + echo "Supported URL formats and schemes:" + echo " http://" + echo " https://" + echo " Check if is reachable via http/https." + echo " ssh://[:]" + echo " Check if has an open port with a listening ssh server." + echo " git://[:]" + echo " The same as ssh://..." + echo " ovpn://[:]" + echo " Check if an OpenVPN server is listening on ." + echo " NOTE: this will not work if 'tls-auth' is enabled but the thing was" + echo " already implemented when I found out about this." + echo " lxc://::" + echo " Proxmox-specific set of checks." + exit + ;; + *) + ;; +esac + + #---------------------------------------------------------------------- source .pct-helpers