.forgejo/workflows/ci.yaml: WIP
/ deploy_script (push) Successful in 1s
Details
/ deploy_script (push) Successful in 1s
Details
This commit is contained in:
parent
bff49abf3d
commit
a31ffb2f48
|
@ -10,6 +10,7 @@ jobs:
|
||||||
- name: Apply zone changes
|
- name: Apply zone changes
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
CURRENT_ZONE=
|
||||||
echo "Preparing to update ${{ vars.DNS_SERVER }}..."
|
echo "Preparing to update ${{ vars.DNS_SERVER }}..."
|
||||||
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
|
git clone ${{ gitea.server_url }}/${{ gitea.repository }} dns
|
||||||
cd dns
|
cd dns
|
||||||
|
@ -20,27 +21,32 @@ jobs:
|
||||||
"--- "*".zone")
|
"--- "*".zone")
|
||||||
CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //')
|
CURRENT_ZONE=$(basename "$line" .zone | sed 's/--- //')
|
||||||
;;
|
;;
|
||||||
|
"--- "*)
|
||||||
|
CURRENT_ZONE=
|
||||||
|
;;
|
||||||
"+++"*)
|
"+++"*)
|
||||||
;;
|
;;
|
||||||
"-"* | "+"*)
|
"-"* | "+"*)
|
||||||
if [[ $line == -* ]]; then # Enregistrement supprimé
|
if [ ! -z CURRENT_ZONE ]; then
|
||||||
RECORD=$(echo "$line" | sed 's/^-//')
|
if [[ $line == -* ]]; then # Enregistrement supprimé
|
||||||
echo "- $RECORD"
|
RECORD=$(echo "$line" | sed 's/^-//')
|
||||||
# nsupdate -k $TSIG_KEY <<EOF
|
echo "- $RECORD"
|
||||||
# server $DNS_SERVER
|
# nsupdate -k $TSIG_KEY <<EOF
|
||||||
# zone $CURRENT_ZONE
|
# server $DNS_SERVER
|
||||||
# update delete $RECORD
|
# zone $CURRENT_ZONE
|
||||||
# send
|
# update delete $RECORD
|
||||||
# EOF
|
# send
|
||||||
elif [[ $line == +* ]]; then # Enregistrement ajouté
|
# EOF
|
||||||
RECORD=$(echo "$line" | sed 's/^+//')
|
elif [[ $line == +* ]]; then # Enregistrement ajouté
|
||||||
echo "+ $RECORD"
|
RECORD=$(echo "$line" | sed 's/^+//')
|
||||||
# nsupdate -k $TSIG_KEY <<EOF
|
echo "+ $RECORD"
|
||||||
# server $DNS_SERVER
|
# nsupdate -k $TSIG_KEY <<EOF
|
||||||
# zone $CURRENT_ZONE
|
# server $DNS_SERVER
|
||||||
# update add $RECORD
|
# zone $CURRENT_ZONE
|
||||||
# send
|
# update add $RECORD
|
||||||
# EOF
|
# send
|
||||||
|
# EOF
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue