From 901bf0fb8c5407a3e74bc782e8eb28eb47dab6ef Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 19 Oct 2019 00:37:39 +0300 Subject: pleroma_ctl: Fix attempting to use RPC for config generation --- rel/files/bin/pleroma_ctl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rel/files/bin') diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl index 90f87a990..9fc5b0bad 100755 --- a/rel/files/bin/pleroma_ctl +++ b/rel/files/bin/pleroma_ctl @@ -141,8 +141,8 @@ else ACTION="$1" shift - - if [ "$(echo \"$1\" | grep \"^-\" >/dev/null)" = false ]; then + echo "$1" | grep "^-" >/dev/null + if [ $? -eq 1 ]; then SUBACTION="$1" shift fi -- cgit v1.2.3 From f3451e723bbc1adb879908532525d54dba1b601a Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 24 Oct 2019 23:28:59 +0300 Subject: pleroma_ctl: fix crashes due to different shift(1) behavior on dash --- rel/files/bin/pleroma_ctl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'rel/files/bin') 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 -- cgit v1.2.3