Skip to content

Instantly share code, notes, and snippets.

@caffeinetiger
Created August 14, 2025 19:49
Show Gist options
  • Save caffeinetiger/6357750e54f113983973d1b7d1b0cbab to your computer and use it in GitHub Desktop.
Save caffeinetiger/6357750e54f113983973d1b7d1b0cbab to your computer and use it in GitHub Desktop.
Script to update teleport client to match server for macOS users
#! /bin/bash
# Script requires curl and jq to execute properly
# Set teleport server
TELEPORT_SERVER="teleport.example.com"
# Get teleport server version
TELEPORT_VERSION=$(curl -s https://$TELEPORT_SERVER/webapi/find | jq -r '.server_version')
echo "$TELEPORT_SERVER teleport server version: $TELEPORT_VERSION"
# Download client package
echo "Downloading teleport client package..."
curl -O https://cdn.teleport.dev/teleport-$TELEPORT_VERSION.pkg
# Find and set install path for client package. Defaults to /usr/local/bin/
if command -v teleport >/dev/null 2>&1; then
echo "Teleport client is already installed. Installing to the same path..."
PKG_TARGET=$(dirname "$(command -v teleport)")
else
echo "Teleport client is not installed. Installing to /usr/local/bin..."
PKG_TARGET="/usr/local/bin"
fi
# Install client package
echo "Installing teleport client to $PKG_TARGET..."
sudo installer -pkg teleport-$TELEPORT_VERSION.pkg -target /usr/local/bin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment