Skip to content

Commit

Permalink
SECZ-1582: Add Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
rbamos committed Jul 9, 2024
1 parent 76d6d10 commit e7370f7
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
# xcode command line tools installation will hang on OS versions lower than this
MIN_OS_VERSION="12.4.0"
CURRENT_OS_VERSION=$(sw_vers -productVersion)
kernel_name=$(uname -s)

if [[ kernel_name != 'Darwin' ]] && [[ kernel_name != 'Linux' ]]; then
red_echo "This script is only supported on MacOS and Linux."
exit
fi

. ./utils.sh

Expand All @@ -23,14 +29,13 @@ fi

# Install Homebrew if not installed
# This may optionally install the Xcode CLT if it is not already installed.
which -s brew
if [[ $? != 0 ]] ; then
if ! which -s brew ; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# If using an M1 machine, load shell environment to run brew commands
if [[ $(uname -m) == 'arm64' ]]; then
echo # Set PATH, MANPATH, etc., for Homebrew. >> ~/.zprofile
echo eval "$(/opt/homebrew/bin/brew shellenv)" >> ~/.zprofile
if [[ "$kernel_name" == "Darwin" ]] && [[ $(uname -m) == 'arm64' ]]; then
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
Expand All @@ -41,13 +46,13 @@ brew install python
brew install awscli

# If using an M1 machine, add a symlink for the AWS credential files to where Leapp expects them
if [[ $(uname -m) == 'arm64' ]]; then
if [[ "$kernel_name" == "Darwin" ]] && [[ $(uname -m) == 'arm64' ]]; then
sudo ln -s /opt/homebrew/bin/aws /usr/local/bin/aws
fi

# If the app store version of filezilla is installed, it expects the .aws credentials
# to be in the filezilla installation directory. Add a symlink there.
if [ -d ~/Library/Containers/org.filezilla-project.filezilla.sandbox ]; then
if [[ "$kernel_name" == "Darwin" ]] && [ -d ~/Library/Containers/org.filezilla-project.filezilla.sandbox ]; then
ln -s ~/.aws ~/Library/Containers/org.filezilla-project.filezilla.sandbox/Data/.aws
fi

Expand All @@ -57,8 +62,13 @@ brew install --cask session-manager-plugin
# Install Leapp CLI
brew install Noovolari/brew/leapp-cli

# Leapp integration setup
LEAPP=/Applications/Leapp.app
if [[ "$kernel_name" == "Darwin" ]]; then
# Leapp integration setup
LEAPP=/Applications/Leapp.app
elif [[ "$kernel_name" == "Linux" ]]; then
LEAPP=/usr/bin/leapp
fi


# Check if Leapp is installed
if [ -d "$LEAPP" ]; then
Expand Down

0 comments on commit e7370f7

Please sign in to comment.