:	Makefile for installing uucp
:	============================
:
:	Sets the right modes on all uucp programs
:
:	Must be run by super-user
:
:	Written by mh at Diab 1986-04-01 { no joke! }
:
:	'(c) DataIndustrier DIAB AB 1986'
:
:	------------------------------------------------------------
:
:	Set up user and group names, paths, file lists, and modes
:
UUUCP=uucp
GUUCP=uucp
UROOT=root
GROOT=root
:
PROOT=/
PUUCP=${PROOT}usr/lib/uucp
PBIN=${PROOT}usr/bin
PSPOOL=${PROOT}usr/spool/uucp
PPUB=${PROOT}usr/spool/uucppublic
PXQT=${PROOT}usr/spool/uucp/.XQTDIR
:
CUUCP="uucico uuclean uuxqt"
CBIN="uucp uulog uux"
SUUCP="L-devices L-dialcodes L.sys daily hourly USERFILE"
:
MCUUCP=04111
MCBIN=04111
MSUUCP=0440
MPUUCP=0711
MPSPOOL=0770
MPPUB=0777
MPXQT=0770
:
:	Set up directories
:
mkdir ${PUUCP} ${PSPOOL} ${PPUB} ${PXQT} 2>/dev/null
chown ${UUUCP} ${PUUCP} ${PSPOOL} ${PPUB} ${PXQT}
chgrp ${GUUCP} ${PUUCP} ${PPUB}
chgrp ${GROOT} ${PSPOOL} ${PXQT}
chmod ${MPUUCP} ${PUUCP}
chmod ${MPPUB} ${PPUB}
chmod ${MPSPOOL} ${PSPOOL}
chmod ${MPXQT} ${PXQT}
:
:	Add entries to /usr/lib/crontab
:
cat >>/usr/lib/crontab <<EOF
0 3 * * * ${PUUCP}/daily
10 * * * * ${PUUCP}/hourly
EOF
:
:	Make default files if they do not exist
:
cd ${PUUCP}
:
if [ ! -f L-devices ]
then	echo Making L-devices
	cat >L-devices <<EOF
DIR modem00 0 1200
EOF
fi
:
if [ ! -f L-dialcodes ]
then	echo Making L-dialcodes
	cat >L-dialcodes <<EOF
EOF
fi
:
if [ ! -f L.sys ]
then	echo Making L.sys
	cat >L.sys <<EOF
DIAB-00 Wk0800-1700 modem00 1200 7587591 login:--login:--login: my-name ssword: my-password
EOF
fi
:
if [ ! -f USERFILE ]
then	echo Making USERFILE
	cat >USERFILE <<EOF
, /usr/spool/uucppublic
EOF
fi
:
:	Make some "cron" files
:
cat >daily <<EOF
cd ${PUUCP}
uuclean -pTM -pC. -pD.
uuclean -pST -pLCK -pLTM -n12
cd ${PSPOOL}
mv LOGFILE OLDLOG
mv SYSLOG OLDSYSLOG
cat OLDSYSLOG >>OLDSYS
rm OLDSYSLOG
EOF
:
cat >hourly <<EOF
cd ${PUUCP}
uulog
uucico -r1
EOF
:
:	Set modes in ${PUUCP}
:
cd ${PUUCP}
chown ${UUUCP} ${CUUCP} ${SUUCP}
chown ${UROOT} uuxqt
chgrp ${GUUCP} ${CUUCP}
chgrp ${GROOT} ${SUUCP}
chmod ${MCUUCP} ${CUUCP}
chmod ${MSUUCP} ${SUUCP}
:
:	Set modes in ${PBIN}
:
cd ${PBIN}
chown ${UUUCP} ${CBIN}
chgrp ${GUUCP} ${CBIN}
chmod ${MCBIN} ${CBIN}
:
:	Done!!!
:
exit 0
