Housekeeping
- Update README - Run shellcheck on .sh files - Add helper scripts - Remove eirene vm variant - Add post-install checklist Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
21
scripts/remove-user.sh
Executable file
21
scripts/remove-user.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$#" -ne 2 ]]; then
|
||||
echo "Usage: $0 <user> <sops-master-key>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
USER="$1"
|
||||
|
||||
AGE_KEY=$(grep "^# public key: " "./users/${USER}/secrets/key.txt" | sed "s/# public key: //")
|
||||
|
||||
for SOPS_FILE in $(find . -type f -name "sops.yaml"); do
|
||||
sed -i "/ - &${USER} ${AGE_KEY}/d" "${SOPS_FILE}"
|
||||
sed -i "/ - \*${USER}/d" "${SOPS_FILE}"
|
||||
done
|
||||
|
||||
"$(dirname "$0")/update-keys.sh" "$2"
|
||||
|
||||
rm -rf ./users/"${USER}"
|
||||
|
||||
echo "User ${USER} has been successfully removed."
|
Reference in New Issue
Block a user