From e2cb5d2aaec6f4a53a66e397358258f9d8ae4c72 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 25 Aug 2026 21:27:30 +0200 Subject: [PATCH] fix abra.sh return states of quitened functions --- abra.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/abra.sh b/abra.sh index ea50a2f..e1f8dd5 100644 --- a/abra.sh +++ b/abra.sh @@ -78,6 +78,7 @@ for group_name in groups: group.users.add(admin) print(f'add akadmin to group {group_name}') """ 2>&1 | quieten + return ${PIPESTATUS[0]} } @@ -108,6 +109,7 @@ with open('/tmp/$1', newline='') as file: group.users.add(new_user) print(f'add {username} to group {group_name}') """ 2>&1 | quieten + return ${PIPESTATUS[0]} } set_user_pass() { @@ -119,7 +121,7 @@ user.set_password('$password') user.save() print('Changed $username password') """ 2>&1 | quieten - + return ${PIPESTATUS[0]} } set_admin_pass() { @@ -157,6 +159,7 @@ else: ) print('Created authentik-bootstrap-token') """ 2>&1 | quieten + return ${PIPESTATUS[0]} } rotate_db_pass() { @@ -182,6 +185,7 @@ update_and_disable_blueprint() { apply_blueprint $@ sleep 1 disable_blueprint $@ 2>&1 | quieten + return ${PIPESTATUS[0]} } disable_blueprint() { @@ -195,6 +199,7 @@ enable_blueprint() { apply_blueprint() { echo apply blueprint $@ ak apply_blueprint $@ 2>&1 | quieten + return ${PIPESTATUS[0]} } blueprint_state() { @@ -212,7 +217,7 @@ time.sleep(1) blueprint.save() print(f'{blueprint.name} enabled: {blueprint.enabled}') """ 2>&1 | quieten - + return ${PIPESTATUS[0]} } # This function adds each application with its name, slug and group if passed @@ -242,6 +247,7 @@ for name, details in applications.items(): app.open_in_new_tab = True app.save() """ 2>&1 | quieten + return ${PIPESTATUS[0]} } # This function adds one application with its name, slug and group if passed @@ -271,6 +277,7 @@ else: app.open_in_new_tab = True app.save() """ 2>&1 | quieten + return ${PIPESTATUS[0]} } ## This function is for renaming apps - usage: rename "old name" "new name" @@ -287,12 +294,13 @@ if app: else: print(f'No application found with name: {old_name}') """ 2>&1 | quieten + return ${PIPESTATUS[0]} } quieten() { # 'SyntaxWarning|version_regex|"http\[' # is a workaround to get rid of some verbose syntax warnings, this might be fixed with another version - grep -Pv '"level": "(info|debug)"|SyntaxWarning|version_regex|"http\[|RuntimeWarning:|### authentik shell|### Node| objects imported automatically|^$' + grep -Pv '"level": "(info|debug)"|SyntaxWarning|version_regex|"http\[|RuntimeWarning:|### authentik shell|### Node| objects imported automatically|^$' || true } add_email_templates() { @@ -413,12 +421,14 @@ saml = provider.samlprovider cert = saml.signing_kp print(''.join(cert.certificate_data.splitlines()[1:-1])) """ 2>&1 | quieten + return ${PIPESTATUS[0]} } get_user_uid() { /manage.py shell -c """ print(User.objects.filter(username='$1').first().uid) """ 2>&1 | quieten + return ${PIPESTATUS[0]} } get_secrets() {