diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-24 23:28:59 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-25 18:32:09 +0300 |
commit | e91d5a23f4173fa087cf90210b9329294f970b52 (patch) | |
tree | a5a5f79df6f3d606c05b0ce41aa3e86c894943b7 | |
parent | 9b26d1608f5ddd64a146dec3c41b029c1b7a4198 (diff) | |
download | pleroma-e91d5a23f4173fa087cf90210b9329294f970b52.tar.gz |
pleroma_ctl: fix crashes due to different shift(1) behavior on dash
-rwxr-xr-x | rel/files/bin/pleroma_ctl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl index 9fc5b0bad..87c486514 100755 --- a/rel/files/bin/pleroma_ctl +++ b/rel/files/bin/pleroma_ctl @@ -140,11 +140,15 @@ else FULL_ARGS="$*" ACTION="$1" - shift - echo "$1" | grep "^-" >/dev/null + if [ $# -gt 0 ]; then + shift + fi + echo "$1" | grep "^-" >/dev/null if [ $? -eq 1 ]; then SUBACTION="$1" - shift + if [ $# -gt 0 ]; then + shift + fi fi if [ "$ACTION" = "update" ]; then |