Skip to main content

Bash-utils

https://github.com/KiraCore/tools/releases

Bash-utils is a collection of utility functions and aliases for Bash shell scripts developed specifically for KIRA to streamline and simplify the process of executing tasks within the network. It provides various functions for managing environment variables, displaying information, and handling errors.

caution

The prerequisite to securely install BU is COSIGN tool that will guarantee the integrity of the files. It MUST be installed and KIRA’s public key added before proceeding.

note

Always source /etc/profile with . /etc/profile when starting a new terminal to use BU.

Linux

# assume root permissions
sudo -s && . /etc/profile

# Install essential dependencies
apt-get install -y wget

# Define version of BU you want to install
TOOLS_VERSION="v0.3.46"

# Download BU script
if [ -z "$KIRA_COSIGN_PUB" ] ; then
echo "ERROR: KIRA_COSIGN_PUB variable is not set. Please refer to cosign installation to add KIRA's public key path as variable."
exit
fi && \
cd /tmp && FILE_NAME="bash-utils.sh" && rm -rfv ./$FILE_NAME ./${FILE_NAME}.sig && \
UBUNTU_AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36" && \
wget --user-agent="$UBUNTU_AGENT" "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}" -O ./$FILE_NAME && \
wget --user-agent="$UBUNTU_AGENT" "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/${FILE_NAME}.sig" -O ./${FILE_NAME}.sig

# Verify cosign release
cosign verify-blob --key "$KIRA_COSIGN_PUB" --signature "/tmp/${FILE_NAME}.sig" "/tmp/$FILE_NAME" --insecure-ignore-tlog --insecure-ignore-sct

# Install BU
chmod +x ./$FILE_NAME && ./$FILE_NAME bashUtilsSetup && ./etc/profile

# Verify version of BU
bu bashUtilsVersion