Skip to content

Commit d2d56f1

Browse files
committed
chore: Update Coolify installer and scripts to include a function for fetching programming jokes
1 parent 9b48a99 commit d2d56f1

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

other/nightly/install.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
2121

2222
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
2323

24+
getAJoke() {
25+
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
26+
if [ "$JOKES" != "" ]; then
27+
echo -e " - Until then, here's a joke for you:\n"
28+
echo -e "$JOKES\n"
29+
fi
30+
}
2431
CDN="https://cdn.coollabs.io/coolify-nightly"
2532
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
2633
ENV_FILE="/data/coolify/source/.env"
@@ -202,6 +209,7 @@ fi
202209
echo -e "3. Check Docker Installation. "
203210
if ! [ -x "$(command -v docker)" ]; then
204211
echo " - Docker is not installed. Installing Docker. It may take a while."
212+
getAJoke
205213
case "$OS_TYPE" in
206214
"almalinux")
207215
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
477485
echo -e "9. Installing Coolify ($LATEST_VERSION)"
478486
echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
479487
echo -e " - Please wait."
480-
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
481-
if [ "$JOKES" != "" ]; then
482-
echo -e " - Until then, here's a joke for you:\n"
483-
echo -e "$JOKES\n"
484-
fi
488+
getAJoke
485489

486490
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1
487491
echo " - Coolify installed successfully."
488492
rm -f $ENV_FILE-$DATE
489493

490494
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
491-
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
492-
if [ "$JOKES" != "" ]; then
493-
echo -e " - Until then, here's a joke for you:\n"
494-
echo -e "$JOKES\n"
495-
fi
495+
getAJoke
496496

497497
sleep 20
498498
echo -e "\033[0;35m

scripts/install.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ INSTALLATION_LOG_WITH_DATE="/data/coolify/source/installation-${DATE}.log"
2121

2222
exec > >(tee -a $INSTALLATION_LOG_WITH_DATE) 2>&1
2323

24-
CDN="https://cdn.coollabs.io/coolify-nightly"
24+
getAJoke() {
25+
JOKES=$(curl -s --max-time 2 https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
26+
if [ "$JOKES" != "" ]; then
27+
echo -e " - Until then, here's a joke for you:\n"
28+
echo -e "$JOKES\n"
29+
fi
30+
}
31+
CDN="https://cdn.coollabs.io/coolify"
2532
OS_TYPE=$(grep -w "ID" /etc/os-release | cut -d "=" -f 2 | tr -d '"')
2633
ENV_FILE="/data/coolify/source/.env"
2734

@@ -202,6 +209,7 @@ fi
202209
echo -e "3. Check Docker Installation. "
203210
if ! [ -x "$(command -v docker)" ]; then
204211
echo " - Docker is not installed. Installing Docker. It may take a while."
212+
getAJoke
205213
case "$OS_TYPE" in
206214
"almalinux")
207215
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo >/dev/null 2>&1
@@ -477,22 +485,14 @@ chmod -R 700 /data/coolify
477485
echo -e "9. Installing Coolify ($LATEST_VERSION)"
478486
echo -e " - It could take a while based on your server's performance, network speed, stars, etc."
479487
echo -e " - Please wait."
480-
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
481-
if [ "$JOKES" != "" ]; then
482-
echo -e " - Until then, here's a joke for you:\n"
483-
echo -e "$JOKES\n"
484-
fi
488+
getAJoke
485489

486490
bash /data/coolify/source/upgrade.sh "${LATEST_VERSION:-latest}" "${LATEST_HELPER_VERSION:-latest}" >/dev/null 2>&1
487491
echo " - Coolify installed successfully."
488492
rm -f $ENV_FILE-$DATE
489493

490494
echo " - Waiting for 20 seconds for Coolify (database migrations) to be ready."
491-
JOKES=$(curl -s https://v2.jokeapi.dev/joke/Programming?format=txt&type=single&amount=1 || true)
492-
if [ "$JOKES" != "" ]; then
493-
echo -e " - Until then, here's a joke for you:\n"
494-
echo -e "$JOKES\n"
495-
fi
495+
getAJoke
496496

497497
sleep 20
498498
echo -e "\033[0;35m

0 commit comments

Comments
 (0)