diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-24 23:28:59 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-24 23:28:59 +0300 |
commit | f3451e723bbc1adb879908532525d54dba1b601a (patch) | |
tree | bbddbf4da9dafe81880bf9d4154006f138bbe2d1 /rel/files/bin/pleroma_ctl | |
parent | 07a6f8b8a33a137101dd1ceebc4fb5f5748c055b (diff) | |
download | pleroma-f3451e723bbc1adb879908532525d54dba1b601a.tar.gz pleroma-f3451e723bbc1adb879908532525d54dba1b601a.zip |
pleroma_ctl: fix crashes due to different shift(1) behavior on dash
Diffstat (limited to 'rel/files/bin/pleroma_ctl')
-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 |