Skip to content

Instantly share code, notes, and snippets.

@rodrigo-x
Last active December 8, 2023 04:25
Show Gist options
  • Save rodrigo-x/c94d65b77c33ddf4383f0b99ef637e08 to your computer and use it in GitHub Desktop.
Save rodrigo-x/c94d65b77c33ddf4383f0b99ef637e08 to your computer and use it in GitHub Desktop.
good!
#!/usr/bin/env bash
# Autor: Nery
# Data: 8/12/2023
# Descrição: Remove todas as senhas do Seahorse
XDG_CONFIG_HOME="$HOME/.config"
function list_keyring_dirs() {
local keyrings_dir="$XDG_CONFIG_HOME/seahorse/keyrings"
for keyring_dir in "$keyrings_dir"/*; do
echo "$keyring_dir"
done
}
function remove_seahorse_passwords() {
local keyring_dirs
local success=false
keyring_dirs=$(list_keyring_dirs)
for keyring_dir in "${keyring_dirs[@]}"; do
try {
rmdir "$keyring_dir"
success=true
} catch {
echo "Erro ao remover o diretório de chaveiro '$keyring_dir'."
}
done
return $success
}
function verify_seahorse() {
if ! seahorse_installed; then
echo "O aplicativo de gerenciamento de chaveiro Seahorse não está instalado."
exit 1
fi
}
verify_seahorse
# Remover senhas do Seahorse
success=$(remove_seahorse_passwords)
# Sucesso
# Verifica o resultado da remoção das senhas
check_success $success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment