Skip to content

Commit

Permalink
Installer Scripts: use bash instead of sh (#34039)
Browse files Browse the repository at this point in the history
* Installer Scripts: use bash instead of sh

The agentless version of this script uses `bash`.
Using `bash` over `sh` should help the maitenance of the script.
It's being used for the agentless version and the node join script
`sh` is sometimes an alias to `bash`, and testing this script in those
systems might lead to assume that the script is working fine, even tho
when running in a real `sh` it will fail.

* use the same expression that is being used in agentless
  • Loading branch information
marcoandredinis committed Nov 2, 2023
1 parent ccf3a9b commit 7fdeae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/types/installers/installer.sh.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

set -eu

Expand Down Expand Up @@ -44,7 +44,7 @@ on_azure() {
sudo apt-get install -y ${PACKAGE_LIST}
elif [ "$ID" = "amzn" ] || [ "$ID" = "rhel" ]; then
if [ "$ID" = "rhel" ]; then
VERSION_ID=$(echo "$VERSION_ID" | sed 's/\..*//') # convert version numbers like '7.2' to only include the major version
VERSION_ID=${VERSION_ID//\.*/} # convert version numbers like '7.2' to only include the major version
fi
sudo yum-config-manager --add-repo \
"$(rpm --eval "https://yum.releases.teleport.dev/$ID/$VERSION_ID/Teleport/%{_arch}/{{ .RepoChannel }}/teleport.repo")"
Expand Down

0 comments on commit 7fdeae2

Please sign in to comment.