]> git.giorgioravera.it Git - scripts.git/commitdiff
Added procedure to select single host
authorGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 26 Jan 2023 19:05:46 +0000 (20:05 +0100)
committerGiorgio Ravera <giorgio.ravera@gmail.com>
Thu, 26 Jan 2023 19:05:46 +0000 (20:05 +0100)
update_certificate

index 2a62bf0d16645454690c54504fb57249d9ce26ac..bad5b8836b267a9a6d64561c79b9adb7a377e19a 100755 (executable)
@@ -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 $@