This makes the beginning of all files the same and a little simpler.
`${0%/*}` turns "/home/user/repository/bin/blackbox_edit" into
"/home/user/repository/bin", exactly like basename but without eating a
process.
Because other scripts needed `$blackbox_home` I made this into a
standardard variable that's always available.
This also loads _stack_lib.sh always because _blackbox_common.sh
requires it.
28 lines
623 B
Bash
Executable File
28 lines
623 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
#
|
|
# blackbox_removeadmin -- Remove an admin to the system
|
|
# NOTE: Does not remove admin from the keyring.
|
|
#
|
|
|
|
# Example:
|
|
# blackbox_removeadmin tal@example.com
|
|
#
|
|
|
|
set -e
|
|
source "${0%/*}/_blackbox_common.sh"
|
|
|
|
fail_if_not_in_repo
|
|
|
|
KEYNAME="$1"
|
|
: "${KEYNAME:?ERROR: First argument must be a keyname (email address)}" ;
|
|
|
|
# Remove the email address from the BB_ADMINS file.
|
|
remove_line "$BB_ADMINS" "$KEYNAME"
|
|
|
|
# Make a suggestion:
|
|
echo
|
|
echo
|
|
echo 'NEXT STEP: Check these into the repo. Probably with a command like...'
|
|
echo $VCS_TYPE commit -m\'REMOVED ADMIN: $KEYNAME\' "$BLACKBOXDATA/$BB_ADMINS_FILE"
|