.forgejo/workflows/ci.yaml: correcting error with record parsing
/ deploy_script (push) Successful in 2s Details

This commit is contained in:
Adrien Bourmault 2024-08-20 18:41:55 +02:00
parent acbefe3dda
commit 49fdfdcf8f
Signed by: neox
GPG Key ID: 57BC26A3687116F6
1 changed files with 2 additions and 2 deletions

View File

@ -31,13 +31,13 @@ jobs:
"-"* | "+"*)
if [ ! -z $CURRENT_ZONE ]; then
if [[ $line == -* ]]; then # Enregistrement supprimé
RECORD=$(echo "$line" | sed 's/^+//' | sed 's/^\([^ ]\+\)\(\s\+\)\(IN A\)\(\s\+\)[^ ]\+/\1.a-lec.org.\2\3/')
RECORD=$(echo "$line" | sed 's/^-//' | sed 's/^\([^ ]\+\)\(\s\+\)\(IN\s\+\)\([^ ]\+\)\s.*/\1.a-lec.org.\2\3\4/')
echo "update delete $RECORD"
echo -e "server ${{vars.DNS_SERVER}}\nupdate delete $RECORD\nsend" > temp_delete
nsupdate -k temp_keyfile temp_delete
rm temp_delete
elif [[ $line == +* ]]; then # Enregistrement ajouté
RECORD=$(echo "$line" | sed 's/^+//' | sed 's/^\([^ ]\+\)\(\s\+\)\(IN A\)/\1.a-lec.org.\2\3/')
RECORD=$(echo "$line" | sed 's/^+//' | sed 's/^\([^ ]\+\)\(\s\+\)\(IN\s\+\)\([^ ]\+\)\(\s\+\)/\1.a-lec.org.\2\3\4\5/')
echo "update add $RECORD"
echo -e "server ${{vars.DNS_SERVER}}\nupdate add $RECORD\nsend" > temp_add
nsupdate -k temp_keyfile temp_add