src.hhvn.uk > hhvn.uk-scripts > file > dns > zone > edit

scripts that power hhvn.uk
Log | Files | Refs | README

edit (330B)


      1 #!/bin/rc
      2 
      3 zone = $1
      4 
      5 fn die {
      6 	echo $* >[1=2]
      7 	exit 1
      8 }
      9 
     10 fn try {
     11 	test -f $1 && doas $EDITOR $1 && exec dns/zone/reload $zone $1
     12 }
     13 
     14 if (! test $#* -lt 2) {
     15 	die 'usage: dns/edit <zone>'
     16 }
     17 
     18 if (~ $zone ()) {
     19 	zone = `hostname
     20 }
     21 
     22 try /var/nsd/zones/master/$zone
     23 try /var/nsd/zones/master/$zone.zone
     24 
     25 die could not guess zone file