Skip to content

Commit

Permalink
nice holidays, what was I doing
Browse files Browse the repository at this point in the history
  • Loading branch information
pintoflager committed Apr 8, 2023
1 parent 154cb19 commit 96a5fdc
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions executor/sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,40 @@ role="$1"

# App installation tasks on a client node. Runs first
if [ "$role" = 'client' ]; then
# TODO: get rid of these notifications. Left for debugging only.
carburator print terminal info "Executing install script on $role"
carburator print terminal info "Executing install script on a client"
fi

# App installation tasks on remote server node.
if [ "$role" = 'server' ]; then
# TODO: get rid of these notifications. Left for debugging only.
carburator print terminal info "Executing install script on $role"
carburator print terminal info "Executing install script on a server"
fi

# Bash needs bash
if ! carburator has program bash; then
carburator print terminal error \
"Missing required program bash. Please install it before proceeding."
exit 120
"Missing required program bash. Trying to install..."
else
exit
fi

# TODO: Just a reminder, to figure out where (any) script runs:
# if [[ $(carburator node role) == 'client' ]]; then ...... ; fi
# TODO: Untested below
if carburator has program apt; then
carburator sudo apt update
carburator sudo apt -y install bash

elif carburator has program pacman; then
carburator sudo pacman -Suy bash

elif carburator has program yum; then
carburator sudo yum makecache --refresh
carburator sudo yum install bash

elif carburator has program dnf; then
carburator sudo dnf makecache --refresh
carburator sudo dnf -y install bash

else
carburator print terminal error \
"Unable to detect package manager from client node linux"
exit 120
fi

0 comments on commit 96a5fdc

Please sign in to comment.