Skip to content

Commit 546845f

Browse files
author
Oliver Cervera
authored
Install curl if not found
Debian does not come with curl by default, so...
1 parent 96e17e5 commit 546845f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

snapraid-aio-script.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ function main(){
5050
echo "## Preprocessing"
5151

5252
# Healthchecks.io start
53-
if [ "$HEALTHCHECKS" -eq 1 ]; then
53+
if [ "$HEALTHCHECKS" -eq 1 ]; then
54+
# install curl if not found
55+
if [ "$(dpkg-query -W -f='${Status}' curl 2>/dev/null | grep -c "ok installed")" -eq 0 ]; then
56+
echo "**Curl has not been found and will be installed.**"
57+
mklog "WARN: Curl has not been found and will be installed."
58+
# super silent and secret install command
59+
export DEBIAN_FRONTEND=noninteractive
60+
apt-get install -qq -o=Dpkg::Use-Pty=0 curl;
61+
fi
5462
echo "Healthchecks.io integration is enabled."
5563
curl -fsS -m 5 --retry 3 -o /dev/null https://hc-ping.com/"$HEALTHCHECKS_ID/start"
5664
fi
@@ -65,7 +73,7 @@ function main(){
6573
mklog "INFO: Script configuration file found!"
6674
fi
6775

68-
# install markdown if not present
76+
# install markdown if not found
6977
if [ "$(dpkg-query -W -f='${Status}' python-markdown 2>/dev/null | grep -c "ok installed")" -eq 0 ]; then
7078
echo "**Markdown has not been found and will be installed.**"
7179
mklog "WARN: Markdown has not been found and will be installed."

0 commit comments

Comments
 (0)