Skip to content

Commit

Permalink
startstop: reverse stop
Browse files Browse the repository at this point in the history
- reverse array
  • Loading branch information
wwwutz committed Jul 15, 2024
1 parent 47f5f6a commit 31b76e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build.profile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BUILD_TAG=2.10.2

BUILD_DIR=.
BUILD_DIR=build
BUILD_SRC="${PWD}"

. build.local
Expand All @@ -18,7 +18,7 @@ BUILD_redis=redis-7.2.5
BUILD_python=Python-3.11.9
BUILD_node=node-20.15.0
BUILD_ffmpeg=ffmpeg-7.0
BUILD_pngquant=pngquant-3.0.3-3-gdbb78b1
BUILD_pngquant=pngquant-3.0.3-4-ged62a8b
BUILD_unpaper=unpaper-7.0.0-125-gfe89949
BUILD_zbar=zbar-0.23.93
BUILD_leptonica=leptonica-1.84.1
Expand Down
15 changes: 13 additions & 2 deletions startstop.build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
set -e
set -u
set -x

. build.profile

Expand Down Expand Up @@ -181,8 +182,18 @@ cmd="\${1:-help}"
srv="\${2:-all}"
if [[ \${srv} = 'all' ]]; then
srv_migrate
for srv in redis nginx gunicorn consumer scheduler worker; do
_srv=(redis nginx gunicorn consumer scheduler worker)
if [[ \${cmd} = 'start' ]]; then
srv_migrate
fi
# poor mans reverse
if [[ \${cmd} = 'stop' ]]; then
_srv=\$(eval eval echo "'\"\${_srv['{\$((\${#_srv[@]}-1))..0}']}\"'")
fi
for "\${_srv[@]}"; do
echo "### ./startstop.sh \${cmd} \${srv}"
"${PROJECT}"/startstop.sh \${cmd} \${srv} || echo "RET: $?"
done
Expand Down

0 comments on commit 31b76e2

Please sign in to comment.