diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-17 22:30:33 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-17 22:30:33 +0200 |
| commit | 804b31cc0c8415ebc79ccddf534dd09c5e6484a0 (patch) | |
| tree | 4e5222126e358d0ea34a63b2fab45102e8c03c24 /scripts | |
| parent | 91f2af4f5ce2f295c5d0a8bfd22b8c3bcc5f6966 (diff) | |
| download | bokf-0.1.4.tar.gz bokf-0.1.4.zip | |
bokftui: remember server/user, BOKFD_TOKEN auto-login, sudo credential launcherv0.1.4
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/bokftui-sudo | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/bokftui-sudo b/scripts/bokftui-sudo new file mode 100755 index 0000000..fc300ae --- /dev/null +++ b/scripts/bokftui-sudo @@ -0,0 +1,21 @@ +#!/bin/sh +# Start bokftui with a credential from a root-only file, unlocked with sudo. +# Looks for /etc/bokf/tui-token (preferred) then /etc/bokf/tui-password. +# The server and user are remembered by bokftui itself in +# ~/.config/bokf/tui.conf. +set -eu + +sudo -v + +if token=$(sudo cat /etc/bokf/tui-token 2>/dev/null) && [ -n "$token" ]; then + BOKFD_TOKEN="$token" + export BOKFD_TOKEN +elif pass=$(sudo cat /etc/bokf/tui-password 2>/dev/null) && [ -n "$pass" ]; then + BOKFD_PASSWORD="$pass" + export BOKFD_PASSWORD +else + echo "bokftui-sudo: no /etc/bokf/tui-token or /etc/bokf/tui-password" >&2 + exit 1 +fi + +exec bokftui "$@" |
