#!/bin/bash USER_FILE="ids.txt" CONFIG_FILE="/etc/gitea/app.ini" # Skip the header line, parse only inactive users awk 'NR > 1 && tolower($4) == "false" { print $1, $2 }' "$USER_FILE" | while read -r userid username; do error_output=$(gitea admin user delete --id "$userid" --purge 2>&1) #echo "Deleting $userid $username" if [ $? -ne 0 ]; then echo "Failed to delete user ID $userid ($username)" echo "Error: $error_output" else echo "Successfully deleted user ID $userid ($username)" fi done