Courrier zsh: PATH launchd + gotcha variable spéciale zsh 'path'; fix [hidden] CSS; vérif md5 au déploiement
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 changed file +4 −2
modified
deploy/courier.sh
+4 −2
@@ -19,12 +19,14 @@ while true; do | |||||
| 19 | id=${f:t:r} | 19 | id=${f:t:r} | ||
| 20 | hdr=$(head -1 $f) | 20 | hdr=$(head -1 $f) | ||
| 21 | parts=(${(z)hdr}) | 21 | parts=(${(z)hdr}) | ||
| 22 | − ip=$parts[1]; port=$parts[2]; path=$parts[3]; tmo=${parts[4]:-30} | 22 | + # NB: ne JAMAIS nommer une variable `path` en zsh — c'est le tableau | ||
| 23 | + # spécial lié à PATH (l'assigner détruit le PATH du process). | ||||
| 24 | + ip=$parts[1]; port=$parts[2]; jpath=$parts[3]; tmo=${parts[4]:-30} | ||||
| 23 | tail -n +2 $f | /usr/bin/ssh -i $KEY \ | 25 | tail -n +2 $f | /usr/bin/ssh -i $KEY \ | ||
| 24 | -o StrictHostKeyChecking=accept-new -o BatchMode=yes -o ConnectTimeout=8 \ | 26 | -o StrictHostKeyChecking=accept-new -o BatchMode=yes -o ConnectTimeout=8 \ | ||
| 25 | -o ControlMaster=auto -o ControlPath=/tmp/kg-cm-%h -o ControlPersist=120 \ | 27 | -o ControlMaster=auto -o ControlPath=/tmp/kg-cm-%h -o ControlPersist=120 \ | ||
| 26 | simon-pierreboucher@$ip \ | 28 | simon-pierreboucher@$ip \ | ||
| 27 | − "/usr/bin/curl -s -m $tmo -X POST http://127.0.0.1:$port$path -H 'Content-Type: application/json' -H 'X-KA-Token: $KA_GUARDIAN_TOKEN' -d @- -w '\n%{http_code}'" \ | 29 | + "/usr/bin/curl -s -m $tmo -X POST http://127.0.0.1:$port$jpath -H 'Content-Type: application/json' -H 'X-KA-Token: $KA_GUARDIAN_TOKEN' -d @- -w '\n%{http_code}'" \ | ||
| 28 | > $SPOOL/tmp/$id.resp 2>>$SPOOL/courier.log | 30 | > $SPOOL/tmp/$id.resp 2>>$SPOOL/courier.log | ||
| 29 | rc=$? | 31 | rc=$? | ||
| 30 | [[ $rc -ne 0 ]] && print "\ncourier_ssh_rc_$rc" >> $SPOOL/tmp/$id.resp | 32 | [[ $rc -ne 0 ]] && print "\ncourier_ssh_rc_$rc" >> $SPOOL/tmp/$id.resp | ||
| 31 | 33 | ||||