Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit d2057ac

Browse files
committed
feat(install): check for curl before installing
1 parent 7d67080 commit d2057ac

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ services:
2222
- redis
2323
- postgres
2424
redis:
25-
image: redis:5.0.9
25+
image: redis:6.0.6
2626
restart: always
2727
command: ["redis-server", "--requirepass", "${RCTF_REDIS_PASSWORD}"]
2828
networks:

install/install.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,13 @@ do_install() {
2626
info "Installing rCTF..."
2727

2828
if [ ! "$(id -u)" = 0 ]; then
29-
error "You must run this script as root."
30-
exit 1
29+
error "You must run this script as root."
30+
exit 1
31+
fi
32+
33+
if [ ! -x "$(command -v curl)" ]; then
34+
error "curl is not available. You must have curl to install rCTF."
35+
exit 1
3136
fi
3237

3338
RCTF_INSTALL_PATH="${RCTF_INSTALL_PATH:-"/opt/rctf"}"
@@ -101,13 +106,13 @@ do_install() {
101106
read -r result </dev/tty
102107

103108
if [ "$result" = "y" ]; then
104-
info "Running 'docker-compose up -d'..."
105-
docker-compose up -d
106-
info "rCTF is now running at 127.0.0.1:8080."
107-
exit 0
109+
info "Running 'docker-compose up -d'..."
110+
docker-compose up -d
111+
info "rCTF is now running at 127.0.0.1:8080."
112+
exit 0
108113
else
109-
info "If you would like to start rCTF, run 'docker-compose up -d' in $RCTF_INSTALL_PATH."
110-
exit 0
114+
info "If you would like to start rCTF, run 'docker-compose up -d' in $RCTF_INSTALL_PATH."
115+
exit 0
111116
fi
112117
}
113118

0 commit comments

Comments
 (0)