From e561d2714c0697b3fe6fed79bac58801f0045714 Mon Sep 17 00:00:00 2001 From: Giorgio Ravera Date: Thu, 26 Jan 2023 20:05:46 +0100 Subject: [PATCH] Added procedure to select single host --- update_certificate | 70 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/update_certificate b/update_certificate index 2a62bf0..bad5b88 100755 --- a/update_certificate +++ b/update_certificate @@ -148,18 +148,70 @@ function update_pve () { echo " ------------------------------- " host="pve.giorgioravera.it" user="root" - command="cat $dst_tmp_cert > /etc/pve/local/pve-ssl.pem && - cat $dst_tmp_key > /etc/pve/local/pve-ssl.key && + command="cat $dst_tmp_cert > /etc/pve/local/pveproxy-ssl.pem && + cat $dst_tmp_key > /etc/pve/local/pveproxy-ssl.key && systemctl restart pveproxy.service && systemctl restart nginx.service" update_certificate echo "" } -update_server -update_docker -update_asterisk -update_nas -update_firewall -update_xenserver -#update_pve \ No newline at end of file +# Update all nodes +function update_all () +{ + update_server + update_docker + update_asterisk + update_nas + update_firewall + #update_xenserver + #update_pve +} + +# Parse Options +function parse_options () +{ + if [ $# -eq 0 ]; then + update_all + exit + fi + + # Parse Options + while [ $# -gt 0 ]; do + case $1 in + server ) + update_server + shift + ;; + docker ) + update_docker + shift + ;; + asterisk ) + update_asterisk + shift + ;; + nas ) + update_nas + shift + ;; + firewall ) + update_firewall + shift + ;; + xenserver ) + update_xenserver + shift + ;; + pve ) + update_pve + shift + ;; + * ) shift + echo "Wrong node name selected" + ;; + esac + done +} + +parse_options $@ -- 2.47.3