Skip to content

Commit 8bea470

Browse files
committed
master - updated compatibility
1 parent 9336509 commit 8bea470

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

scripts/build.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ if [ "$UPDATE_IMAGES" = "y" ] || [ "$UPDATE_IMAGES" = "Y" ]; then
1111
echo "===== Updating images... ====="
1212
echo
1313

14-
NGINX_VERSION=$(grep -oP '^NGINX_VERSION=\K.*' .env)
15-
PORTAINER_VERSION=$(grep -oP '^PORTAINER_VERSION=\K.*' .env)
14+
NGINX_VERSION=$(sed -n 's/^NGINX_VERSION=//p' .env)
15+
PORTAINER_VERSION=$(sed -n 's/^PORTAINER_VERSION=//p' .env)
1616

1717
docker pull "nginx:$NGINX_VERSION"
1818
docker pull "portainer/portainer-ce:$PORTAINER_VERSION"
@@ -22,8 +22,13 @@ echo
2222
echo "===== Building and starting containers... ====="
2323
echo
2424

25-
docker compose build --no-cache
26-
docker compose up -d
25+
if command -v docker-compose >/dev/null 2>&1; then
26+
docker-compose build --no-cache
27+
docker-compose up -d
28+
else
29+
docker compose build --no-cache
30+
docker compose up -d
31+
fi
2732

2833
echo
2934
echo "===== Done! ====="

scripts/down.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ echo "===== Stopping... ====="
44
echo
55

66
cd scripts || exit
7-
docker compose down
7+
if command -v docker-compose >/dev/null 2>&1; then
8+
docker-compose down
9+
else
10+
docker compose down
11+
fi
812

913
echo
1014
echo "===== Done! ====="

scripts/restart.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ echo "===== Restarting... ====="
44
echo
55

66
cd scripts || exit
7-
docker compose restart
7+
if command -v docker-compose >/dev/null 2>&1; then
8+
docker-compose restart
9+
else
10+
docker compose restart
11+
fi
812

913
echo
1014
echo "===== Done! ====="

scripts/start.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ echo "===== Starting... ====="
44
echo
55

66
cd scripts || exit
7-
docker compose up -d
7+
if command -v docker-compose >/dev/null 2>&1; then
8+
docker-compose up -d
9+
else
10+
docker compose up -d
11+
fi
812

913
echo
1014
echo "===== Done! ====="

0 commit comments

Comments
 (0)