#!/usr/bin/env bash
# csv2cards.sh → html
CSV=${1:-credentials.csv}
OUT=${2:-cards.html}
# start the document
cat >"$OUT" <<'EOF'
Credentials cards
EOF
# read CSV, skip header, emit a per line
awk -F',' 'NR>1{
printf "
\n"
printf "
IP: %s
\n", $1
printf "
Host: %s
\n", $2
printf "
User: %s
\n", $3
printf "
Pass: %s
\n", $4
printf "
\n"
}' "$CSV" >>"$OUT"
# close the document
cat >>"$OUT" <<'EOF'
EOF