Export environment variables in scripts to fix passphrase prompts
- Add 'set -a' and 'set +a' around 'source .env' in healthcheck.sh and restore.sh - Ensures environment variables are exported to child processes (borg, borgmatic) - Fixes issue where scripts would prompt for BORG_PASSPHRASE despite .env being loaded - Update TODO.md: mark completed items, improve formatting Scripts updated: - scripts/healthcheck.sh: Export vars before calling borgmatic commands - scripts/restore.sh: Export vars before calling borg commands 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,11 +13,15 @@ YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Charger les variables d'environnement
|
||||
# Charger et exporter les variables d'environnement
|
||||
if [ -f /etc/borgmatic/.env ]; then
|
||||
set -a
|
||||
source /etc/borgmatic/.env
|
||||
set +a
|
||||
elif [ -f .env ]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
fi
|
||||
|
||||
ERRORS=0
|
||||
|
||||
@@ -13,11 +13,15 @@ YELLOW='\033[1;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Charger les variables d'environnement
|
||||
# Charger et exporter les variables d'environnement
|
||||
if [ -f /etc/borgmatic/.env ]; then
|
||||
set -a
|
||||
source /etc/borgmatic/.env
|
||||
set +a
|
||||
elif [ -f .env ]; then
|
||||
set -a
|
||||
source .env
|
||||
set +a
|
||||
else
|
||||
echo -e "${RED}❌ Fichier .env non trouvé${NC}"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user