xbazzi / delete_inactive_gitea_users.sh
0 gustos
0 bifurcaciones
1 archivos
Última actividad 2 weeks ago
| 1 | #!/bin/bash |
| 2 | |
| 3 | USER_FILE="ids.txt" |
| 4 | CONFIG_FILE="/etc/gitea/app.ini" |
| 5 | |
| 6 | # Skip the header line, parse only inactive users |
| 7 | awk 'NR > 1 && tolower($4) == "false" { print $1, $2 }' "$USER_FILE" | while read -r userid username; do |
| 8 | error_output=$(gitea admin user delete --id "$userid" --purge 2>&1) |
| 9 | #echo "Deleting $userid $username" |
Siguiente
Anterior