From eab20a07c6303266c82abc254eb17e18ac8e29e0 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 12 Apr 2022 01:27:27 +0300 Subject: [PATCH] No create app session if already exists --- pleroma-cli.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pleroma-cli.sh b/pleroma-cli.sh index 984d3fe..0e856bb 100755 --- a/pleroma-cli.sh +++ b/pleroma-cli.sh @@ -28,13 +28,15 @@ fi auth_api_create_client() { - curl -s --compressed --url $instance_point/apps \ - --data-urlencode 'client_name=pleroma-cli' \ - --data-urlencode 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' \ - --data-urlencode 'scopes=read write follow' \ - --data-urlencode 'website=https://gitea.phreedom.club/localhost_frssoft/pleroma-cli' \ - --output .app_sessions/$instance - chmod 600 .app_sessions/$instance + if [ ! -e ".app_sessions/$instance" ]; then + curl -s --compressed --url $instance_point/apps \ + --data-urlencode 'client_name=pleroma-cli' \ + --data-urlencode 'redirect_uris=urn:ietf:wg:oauth:2.0:oob' \ + --data-urlencode 'scopes=read write follow' \ + --data-urlencode 'website=https://gitea.phreedom.club/localhost_frssoft/pleroma-cli' \ + --output .app_sessions/$instance + chmod 600 .app_sessions/$instance + fi } auth_api_get_code()