src.hhvn.uk > hhvn.uk-scripts > file > dkim > update

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

update (561B)


      1 #!/bin/rc -ex
      2 
      3 # This script combines other scripts in this directory to automatically
      4 # generate keypairs and reconfigure relevant servers to use them
      5 
      6 selector  = `{date +%Y%m%d}
      7 dkimfiles = `{dkim/mkcert $selector}
      8 rsapriv   = $dkimfiles(1)
      9 rsatxt    = $dkimfiles(2)
     10 edpriv    = $dkimfiles(3)
     11 edtxt     = $dkimfiles(4)
     12 domain    = $1
     13 zonefile  = $2
     14 
     15 if (test $#* -gt 2) {
     16 	echo 'usage: dkim/update [domain] [zonefile]' >[1=2]
     17 	exit 2
     18 }
     19 
     20 dkim/reconfig-smtpd $rsapriv $edpriv $domain
     21 dkim/reconfig-dns   $rsatxt  $edtxt  $selector $domain $zonefile
     22 dkim/purge