From 81abb03b8a9ef6d8867bb56508d19301c4625d37 Mon Sep 17 00:00:00 2001 From: Override-6 Date: Sun, 4 Dec 2022 21:09:12 +0100 Subject: [PATCH] drone script fixes --- drone/prepare-deliver.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drone/prepare-deliver.sh b/drone/prepare-deliver.sh index 232a436..dffd314 100755 --- a/drone/prepare-deliver.sh +++ b/drone/prepare-deliver.sh @@ -1,11 +1,20 @@ #!/usr/bin/env bash -#use the right command to install packages -if [ "$(command -v apt)" ]; then CMD=apt; else CMD=yum; fi - echo "installing packages..." -eval $CMD update > /dev/null -eval $CMD -y install openssh-client openssh-clients > /dev/null +#use the right command to install packages +if [ "$(command -v apt)" ]; then + apt update > /dev/null + apt -y install openssh-client openssh-clients > /dev/null +elif [ "$(command -v yum)" ]; then + yum update > /dev/null + yum -y install openssh-client openssh-clients > /dev/null +elif [ "$(command -v apk)" ]; then + apk update > /dev/null + apk add openssh-client openssh-clients > /dev/null +else + echo "could not find a package manager, anborting" >&2 + exit 1 +fi echo "done." mkdir /root/.ssh