From: rinpatch Date: Thu, 24 Oct 2019 20:28:59 +0000 (+0300) Subject: pleroma_ctl: fix crashes due to different shift(1) behavior on dash X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e91d5a23f4173fa087cf90210b9329294f970b52;p=akkoma pleroma_ctl: fix crashes due to different shift(1) behavior on dash --- 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