diff options
author | Tuan Van <langthang@gentoo.org> | 2006-07-15 23:47:38 +0000 |
---|---|---|
committer | Tuan Van <langthang@gentoo.org> | 2006-07-15 23:47:38 +0000 |
commit | 9c9f03ccc9e2c1850a852e230772253cbc78a46f (patch) | |
tree | 22b7bf3ae970fa535cb427d7980eab8623f457ae /mail-filter/dk-milter | |
parent | stable x86; tcl/tk =/ (diff) | |
download | gentoo-2-9c9f03ccc9e2c1850a852e230772253cbc78a46f.tar.gz gentoo-2-9c9f03ccc9e2c1850a852e230772253cbc78a46f.tar.bz2 gentoo-2-9c9f03ccc9e2c1850a852e230772253cbc78a46f.zip |
convert gentxt.csh to gentxt.sh
(Portage version: 2.1.1_pre2-r6)
Diffstat (limited to 'mail-filter/dk-milter')
-rw-r--r-- | mail-filter/dk-milter/ChangeLog | 6 | ||||
-rw-r--r-- | mail-filter/dk-milter/dk-milter-0.4.1.ebuild | 4 | ||||
-rwxr-xr-x | mail-filter/dk-milter/files/gentxt.sh | 52 |
3 files changed, 59 insertions, 3 deletions
diff --git a/mail-filter/dk-milter/ChangeLog b/mail-filter/dk-milter/ChangeLog index 3b8620e76413..fb04585a8700 100644 --- a/mail-filter/dk-milter/ChangeLog +++ b/mail-filter/dk-milter/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for mail-filter/dk-filter # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.2 2006/07/15 23:27:10 langthang Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/ChangeLog,v 1.3 2006/07/15 23:47:37 langthang Exp $ + + 15 Jul 2006; Tuấn Văn <langthang@gentoo.org> +files/gentxt.sh, + dk-milter-0.4.1.ebuild: + convert gentxt.csh to gentxt.sh 15 Jul 2006; Tuấn Văn <langthang@gentoo.org> dk-milter-0.4.1.ebuild: s/milter/filter diff --git a/mail-filter/dk-milter/dk-milter-0.4.1.ebuild b/mail-filter/dk-milter/dk-milter-0.4.1.ebuild index cb4260332428..e215eb6366aa 100644 --- a/mail-filter/dk-milter/dk-milter-0.4.1.ebuild +++ b/mail-filter/dk-milter/dk-milter-0.4.1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-0.4.1.ebuild,v 1.2 2006/07/15 23:27:10 langthang Exp $ +# $Header: /var/cvsroot/gentoo-x86/mail-filter/dk-milter/dk-milter-0.4.1.ebuild,v 1.3 2006/07/15 23:47:37 langthang Exp $ inherit eutils @@ -56,7 +56,7 @@ src_install() { install -C "${OBJDIR}"/${dir} \ || die "make install failed" done - dobin dk-filter/gentxt.csh + dobin "$FILESDIR"/gentxt.sh || die "dobin failed" newinitd "${FILESDIR}/dk-filter.init" dk-filter \ || die "newinitd failed" diff --git a/mail-filter/dk-milter/files/gentxt.sh b/mail-filter/dk-milter/files/gentxt.sh new file mode 100755 index 000000000000..f612fb5d968b --- /dev/null +++ b/mail-filter/dk-milter/files/gentxt.sh @@ -0,0 +1,52 @@ +#!/bin/bash +## +## $Id: gentxt.sh,v 1.1 2006/07/15 23:47:38 langthang Exp $ +## +## Copyright (c) 2004, 2005 Sendmail, Inc. and its suppliers. +## All rights reserved. +## +## gentxt.csh -- generate a TXT record for DomainKeys service +## +## Usage: gentext.csh <selector> [<domain>] +## +## This will write a TXT record suitable for insertion into a DNS zone file +## on standard output, and the matching public/private keys will be in +## PEM-formatted files called <selector>.public and <selector>.private, +## respectively, in the current directory. +## +## To translate the record produced by this script, see the DomainKeys +## draft. The script will output a record which advertises an RSA-style +## public key in test mode. + +## langthang@gentoo.org (15 July 2006) +## bash is gentoo default shell +## convert to bash + +# verify usage +if [[ "$3" != "" || "$1" == "" ]] ; then + echo "usage: $0 selector [domain]" + exit 1 +fi + +# copy the argument +selector="$1" +domain="$2" + +# generate a private key +openssl genrsa -out ${selector}.private 512 >& /dev/null + +# generate a public key based on the private key +openssl rsa -in ${selector}.private -out ${selector}.public -pubout \ + -outform PEM >& /dev/null + +# prepare the data +keydata=`grep -v '^-' ${selector}.public` +pubkey=`echo $keydata | sed 's/ //'` + +# output the record +echo -n ${selector}._domainkey IN TXT '"'g=\; k=rsa\; t=y\; p=$pubkey'"' +if [[ "$domain" != "" ]] ; then + echo " ; ----- DomainKey $selector for $domain" +else + echo "" +fi |