|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T m
Length: 3573 (0xdf5) Types: TextFile Names: »make.samples«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« └─⟦e5a54fb17⟧ └─⟦this⟧ »pp-5.0/config/make.samples«
#! /bin/sh info=${info-local.info} infuser=":822-local\ \$host.\$site" inflocal="" firstuser="${firstuser-100}" passwd=${passwd-/etc/passwd} host="_my_host_" site="_my_site_" smtps=_my_smtp_server_ # Set up a sample (simple) set of tables if test -f $info then echo Reading previously stored info from $info ... . ./$info else cat << EOF You appear to have no file $info containing your local details. Please answer the following questions so that this file can be generated. It needs to know your hostname and site name. It will also require a user name for "postmaster" mail. To generate sample user files, it needs to know the userid of the first valid user. This is normally about 100. To configure as an smtp leaf node, it needs to know an smtp host to which all mail can be sent. If you do not support smtp, just hit return. It does not matter if you give silly answers as the generated tables are only intended for testing, but you may as well give the real values. In each case it will tell you the guess it has made in []s. A null reply will select that value. EOF name=${HOST-`hostname`} user=${USER-`whoami`} tsite=${SITE-`domainname`} time=`date` case "$tsite" in uk.[ac][co].*) site=`echo $tsite | awk -F. '{ sep=""; for (i=NF;i>0;i--) { printf "%s%s",sep,$i;sep="."}}'`;; *.*) site="$tsite";; esac case "$name" in uk.[ac][co].*) name=`echo $name | awk -F. '{ sep=""; for (i=NF;i>0;i--) { printf "%s%s",sep,$i; sep="."}}'` esac case "$name" in *.*) host=`expr $name : '\([^.]*\)'` site=`expr $name : '[^.]*\.\(.*\)'`;; *) host=$name esac cat <<EOF The host name required is the name of the host that will run the MTA without any trailing domain components. E.g. for the machine john.cs.nott.ac.uk this value would be john EOF echo -n "host name [$host]: "; read val case "$val" in ?*) host="$val";; esac cat <<EOF The site name is the normal name of your site that is visible to the world. This does not generally contain the machine name. So for the machine john.cs.nott.ac.uk which might run the MTA, the site that the rest of the world will see will be cs.nott.ac.uk This should be a fully qualified domain name EOF echo -n "site name [$site]: "; read val case "$val" in ?*) site="$val";; esac echo -n "user name [$user]: "; read val case "$val" in ?*) user="$val";; esac echo -n "first user [$firstuser]: "; read val case "$val" in ?*) firstuser="$val";; esac echo -n "smtp server [$smtps]: "; read val case "$val" in ?*) smtps="$val";; esac cat <<EOF > $info : tailor information generated by $USER at $time host="$host" site="$site" user="$user" firstuser="$firstuser" smtps="$smtps" EOF cat <<EOF The information has been recorded in $info. If you need to change anything you can edit $info and re-run $0. EOF fi echo "Using information: site=$site, host=$host" echo " user=$user, smtp server=$smtps" echo " " echo -n "Building ..." eval infuser="$infuser" eval inflocal="$inflocal" test -d $host || mkdir $host || echo Failed to mkdir $host/ sed -e "s/_my_site_/$site/g" -e \ "s/_my_host_/$host/g" -e "s/_my_user_/$user/g" -e \ "s/_my_smtp_server_/$smtps/g" < sample.sh | (cd $host; sh) awk < $passwd -F: '{if($3 > '$firstuser') print $1"'"$infuser"'"}' > $host/users awk < $passwd -F: '{if($3 > '$firstuser') print $1 ":" $1}' > $host/ch.local echo "postmaster:alias $user" > $host/aliases grep "^$user:" $host/users > /dev/null || ( echo $user$infuser >> $host/users echo "$user:$user" >> $host/ch.local ) echo "DONE" echo "Tables completed in directory $host/" exit 0