DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T p

⟦e4f4e5d55⟧ TextFile

    Length: 2241 (0x8c1)
    Types: TextFile
    Names: »passwd2alias.sh«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦bfebc70e2⟧ »EurOpenD3/mail/sendmail-5.65b+IDA-1.4.3.tar.Z« 
        └─⟦f9e35cd84⟧ 
            └─⟦this⟧ »sendmail/uiuc/passwd2alias.sh« 

TextFile

#! /bin/sh
#
# Copyright (c) 1990 Paul Pomes
# Copyright (c) 1990 University of Illinois Board of Trustees
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the University of Illinois, Urbana.
#
# The name of the University may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
# passwd2alias is meant to be invoked nightly by cron for the purpose of
# adding aliases to the local machine for everyone listed in the passwd
# file.  This shell will usually be used in conjunction with the m4 defines
# HIDDENNET, HIDDENNETHOST in ../ida/cf/machine.m4 on machines using YP.
# Depending in settings in /etc/netgroup, not all users listed in the YP
# passwd file may be local.  This is overcome by listing everybody in the
# alias file ala
#
# someuser:	someuser@serverhost.domain
#
# where serverhost is the machine which all users are local to.
#
# Configuration:
# Alias file:
AliasFile=/etc/aliases
readonly AliasFile
#
# Processing steps:
#
# 1) Copy /etc/passwd to temp file
# 2) Strip everything from the first ':' on each line on.
# 3) Change lines from
# user
#  to
# user:	user@hostname
#
myhost=`hostname`
sort /etc/passwd > /tmp/a2p.$$
ex - /tmp/a2p.$$ << EOF
1,\$s/:.*//
1,\$s/.*/&:	&@$myhost/
w
q
EOF
#
# 4) Make a backup copy of AliasFile
# 5) Delete all text from the line with "WILL GO AWAY" to the bottom
# 6) Append warning line from step 5 followed by contents of a2p.$$
cp $AliasFile $AliasFile.old
ex - $AliasFile << EOF
g/WILL GO AWAY/.,\$d
\$a
# DO NOT ADD ENTRIES BELOW THIS LINE, OTHERWISE THEY WILL GO AWAY.
# The entries below are added automagically by the $0 program (invoked by cron)
.
\$r /tmp/a2p.$$
w
q
EOF
rm -f /tmp/a2p.$$
newaliases
exit 0