howto/Bird.md
... ...
@@ -326,6 +326,36 @@ WantedBy=timers.target
326 326
327 327
then enable and start the timer with `systemctl enable --now dn42-roa.timer`.
328 328
329
+More advanced script with error checking:
330
+```sh
331
+#!/bin/bash
332
+roa4URL=""
333
+roa6URL=""
334
+
335
+roa4FILE="/etc/bird/roa/roa_dn42.conf"
336
+roa6FILE="/etc/bird/roa/roa_dn42_v6.conf"
337
+
338
+cp "${roa4FILE}" "${roa4FILE}.old"
339
+cp "${roa6FILE}" "${roa6FILE}.old"
340
+
341
+if curl -f -o "${roa4FILE}.new" "${roa4URL};" ;then
342
+ mv "${roa4FILE}.new" "${roa4FILE}"
343
+fi
344
+
345
+if curl -f -o "${roa6FILE}.new" "${roa6URL};" ;then
346
+ mv "${roa6FILE}.new" "${roa6FILE}"
347
+fi
348
+
349
+if birdc configure ; then
350
+ rm "${roa4FILE}.old"
351
+ rm "${roa6FILE}.old"
352
+else
353
+ mv "${roa4FILE}.old" "${roa4FILE}"
354
+ mv "${roa6FILE}.old" "${roa6FILE}"
355
+fi
356
+```
357
+
358
+
329 359
### Use RPKI ROA in bird2
330 360
331 361
* Download gortr