#!/bin/bash
# ═══════════════════════════════════════════════════════════════
# create-htpasswd.sh — Créer le fichier de mots de passe staging
# À lancer UNE SEULE FOIS sur o2switch via SSH :
#   bash create-htpasswd.sh
# ═══════════════════════════════════════════════════════════════

HTPASSWD_FILE="/home/ton-compte/.htpasswd-staging"

echo "Création du fichier de protection staging..."
echo "Entrez le nom d'utilisateur (ex: seb) :"
read USERNAME

htpasswd -c "$HTPASSWD_FILE" "$USERNAME"

echo ""
echo "OK — fichier créé : $HTPASSWD_FILE"
echo "Ajoute d'autres utilisateurs avec : htpasswd $HTPASSWD_FILE NOM"
