2018-10-30 22:05:42 +03:00
|
|
|
:: DNS: configure ip address
|
|
|
|
::
|
2019-06-15 01:15:29 +03:00
|
|
|
:::: /hoon/request/dns/gen
|
2018-10-30 22:05:42 +03:00
|
|
|
::
|
|
|
|
/- *dns, *sole
|
|
|
|
/+ *generators
|
|
|
|
:- %ask
|
|
|
|
|= $: [now=@da eny=@uvJ bec=beak]
|
|
|
|
[arg=$@(~ [addr=@if ~])]
|
|
|
|
~
|
|
|
|
==
|
2019-06-05 04:21:42 +03:00
|
|
|
^- (sole-result [%dns-address address])
|
2018-10-30 22:05:42 +03:00
|
|
|
=* our p.bec
|
2019-06-07 21:36:12 +03:00
|
|
|
=/ rac (clan:title our)
|
2019-06-15 01:15:29 +03:00
|
|
|
::
|
2019-06-07 21:36:12 +03:00
|
|
|
?: ?=(%czar rac)
|
2019-06-15 01:15:29 +03:00
|
|
|
=/ msg1 "galaxy domain requests must be made out-of-band"
|
|
|
|
=/ msg2 "use :dns|auto if you already have an urbit domain"
|
|
|
|
=/ msg3 "see XX for more details or to BYOD"
|
|
|
|
%+ print leaf+msg3
|
|
|
|
%+ print leaf+msg2
|
|
|
|
(print leaf+msg1 no-product)
|
|
|
|
::
|
2019-06-07 21:36:12 +03:00
|
|
|
?: ?=(?(%earl %pawn) rac)
|
2019-06-15 01:15:29 +03:00
|
|
|
=/ msg1 "domain names are not provided for comets and moons"
|
|
|
|
=/ msg2 "see XX for BYOD"
|
|
|
|
%+ print leaf+msg2
|
|
|
|
(print leaf+msg1 no-product)
|
2019-06-07 21:36:12 +03:00
|
|
|
:: invoke parser with arg if present
|
|
|
|
::
|
2018-10-30 22:05:42 +03:00
|
|
|
=- ?~ arg -
|
|
|
|
(fun.q.q addr.arg)
|
|
|
|
%+ prompt
|
|
|
|
[%& %dns-address "ipv4 address: "]
|
|
|
|
%+ parse
|
2019-06-07 21:36:12 +03:00
|
|
|
^- $-(nail (like @if))
|
|
|
|
;~(pfix ;~(pose dot (easy ~)) lip:ag)
|
2018-10-30 22:05:42 +03:00
|
|
|
|= addr=@if
|
2018-11-03 08:17:34 +03:00
|
|
|
?: (reserved:eyre addr)
|
|
|
|
=/ msg "unable to bind reserved ipv4 address {(scow %if addr)}"
|
|
|
|
(print leaf+msg no-product)
|
2018-10-30 22:05:42 +03:00
|
|
|
%- produce
|
2019-06-05 04:21:42 +03:00
|
|
|
[%dns-address %if addr]
|