#!/bin/bash echo -e "\e[32mConfiguring High Availability Add-On for Orchestrator" tput sgr0 usage() { cat <&2 fi ;; esac;; ?) usage exit 1 ;; *) if [ "$OPTERR" != 1 ] || [ "${optspec:0:1}" = ":" ]; then echo "Non-option argument: '-${OPTARG}'" >&2 exit 2 fi ;; esac done download_haa(){ echo -e "\e[32mDownloading High Availability Add-On for Orchestrator" tput sgr0 wget https://download.uipath.com/haa/2.0.1/haa-2.0.1.tar.gz tar -xf haa-2.0.1.tar.gz chmod a+x install.sh } if [[ "$ADVANCED" == "true" ]]; then download_haa echo "Advanced mode selected, please run ./install.sh with optional argumets provided in this help." echo "install.sh: this script installs HAA UiPath pack on the node. When no options are provided, install.sh runs in the interactive mode." echo "install.sh [-y] [-c ] [-s ]" echo " -y Answer 'yes' for all questions instead of awaiting user input." echo " -c Provide a path to the answer-file to modify the installation options." echo " -s Provide a directory for HAA UiPath unix sockets. This is supported only on a fresh install, not in upgrade." echo " --install-dir Provide a path to install HAA UiPath. This is supported only on a fresh install, not in upgrade." echo " --config-dir Provide a path for the configuration directory for HAA UiPath installation. This is supported only on a fresh install, not in upgrade." echo " --var-dir Provide a var_dir for HAA UiPath installation. This is supported only on a fresh install, not in upgrade." echo " --os-user Provide os user for HAA UiPath installation (default - uipath). This is supported only on a fresh install, not in upgrade." echo " --os-group Provide os group for HAA UiPath installation (default - uipath). This is supported only on a fresh install, not in upgrade." echo "Usage examples:" echo " ./install.sh -y" echo " ./install.sh -c answer.file" echo " ./install.sh -s /var/run/haa-uipath" exit 1 fi if [[ -z "$USERNAME" ]] || [[ -z "$PASSWORD" ]]; then usage exit 1 fi email_regex="\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" if [[ $USERNAME =~ $email_regex ]]; then continue else usage exit 1 fi download_haa echo -e "\e[32mInstalling High Availability Add-On for Orchestrator" if [[ "$VERBOSE" == "true" ]]; then bash ./install.sh -y else bash ./install.sh -y 1> /dev/null fi post_create_db(){ cat<