# Track On-Premise Jump Script # This script is designed to be downloaded and executed directly via: # wget -O - https://safectory.com/top | bash -s -- [] [] [] # (Note: Use 'bash -s --' to pass optional parameters to the script!) # Named as .txt file for WordPress upload compatibility. TAR_GZ_URL="https://nexus.beamzone.net:8443/repository/safectory_on_premise/install_track_on_premise.tar.gz" apt-get -y install curl # Helper function to save config option set_config_option() { local key="$1" local value="$2" local config_file="$CONFIG_FILE" # Create config file if it doesn't exist if [ ! -f "$config_file" ]; then touch "$config_file" chmod 600 "$config_file" fi # Check if the key already exists in the config file (then update, otherwise append) if grep -q "^${key}=" "$config_file"; then sed -i "s|^${key}=.*|${key}=\"${value}\"|" "$config_file" else echo "${key}=\"${value}\"" >> "$config_file" fi } # Try to reuse Nexus credentials from existing config file CONFIG_FILE="/etc/track.config" if [ -f "$CONFIG_FILE" ]; then username="$(grep NEXUS_USER $CONFIG_FILE 2>/dev/null | cut -d\" -f2)" password="$(grep NEXUS_PASS $CONFIG_FILE 2>/dev/null | cut -d\" -f2)" fi # Track if credentials are new or changed new_credentials=false # Credential validation loop - retry until successful download while true; do if [ -z "$username" ]; then read -p "Please enter the Nexus username: " username