- #
- # $Id: postinstall.in,v 1.6 2009/09/08 01:05:03 faxguy Exp $
- # Tim Rice
- #
- # postinstall
- #
- #cd /opt/HylaFAX
- #sh make.links
- #
- CMP=@CMP@
- #
- bindir=@BIN@
- sbindir=@SBIN@
- libdatadir=@LIBDATA@
- mandir=@MANDIR@
- spooldir=@SPOOL@
- #
- FAX_U=@FAXUID@
- FAX_G=@FAXGID@
- #
- PKG_O=@SYSUID@
- PKG_G=@SYSGID@
- # update
- if [ -f ${sbindir}/faxcron ]
- then
- ${CMP} -s ${sbindir}/faxcron ${sbindir}/faxcron.dist || {
- echo "Saving faxcron as faxcron.O"
- mv ${sbindir}/faxcron ${sbindir}/faxcron.O
- installf HylaFAX ${sbindir}/faxcron.O f 0755 ${PKG_O} ${PKG_G}
- mv ${sbindir}/faxcron.dist ${sbindir}/faxcron
- }
- else
- mv ${sbindir}/faxcron.dist ${sbindir}/faxcron
- fi
- installf HylaFAX ${sbindir}/faxcron f 0755 ${PKG_O} ${PKG_G}
- rm ${sbindir}/faxcron.dist 2>/dev/null
- removef HylaFAX ${sbindir}/faxcron.dist
- echo "Updating ${spooldir} files"
- for i in bin/ps2fax.gs bin/ps2fax.dps bin/ps2fax.imp bin/pdf2fax.gs
- bin/pcl2fax bin/tiff2fax bin/notify bin/archive
- bin/faxrcvd bin/pollrcvd bin/mkcover bin/wedged
- etc/dpsprinter.ps etc/dialrules etc/dialrules.sf-ba etc/dialrules-pabx.be etc/dialrules.europe
- do
- if [ -f ${spooldir}/${i} ]
- then
- ${CMP} -s ${spooldir}/${i} ${spooldir}/${i}.dist || {
- echo "Saving ${i} as ${i}.O"
- mv ${spooldir}/${i} ${spooldir}/${i}.O
- case $i in
- bin/*)
- installf HylaFAX ${spooldir}/${i}.O f 0755 ${PKG_O} ${PKG_G}
- ;;
- etc/*)
- installf HylaFAX ${spooldir}/${i}.O f 0444 ${PKG_O} ${PKG_G}
- ;;
- esac
- mv ${spooldir}/${i}.dist ${spooldir}/${i}
- }
- else
- mv ${spooldir}/${i}.dist ${spooldir}/${i}
- fi
- case $i in
- bin/*)
- installf HylaFAX ${spooldir}/${i} f 0755 ${PKG_O} ${PKG_G}
- ;;
- etc/*)
- installf HylaFAX ${spooldir}/${i} f 0444 ${PKG_O} ${PKG_G}
- ;;
- esac
- rm ${spooldir}/${i}.dist 2>/dev/null
- removef HylaFAX ${spooldir}/${i}.dist
- done
- # suggest
- if test -f ${libdatadir}/faxcover.ps
- then
- mv ${libdatadir}/faxcover.ps.dist ${libdatadir}/faxcover.ps.N
- installf HylaFAX ${libdatadir}/faxcover.ps.N f 0644 ${PKG_O} ${PKG_G}
- else
- mv ${libdatadir}/faxcover.ps.dist ${libdatadir}/faxcover.ps
- installf HylaFAX ${libdatadir}/faxcover.ps f 0644 ${PKG_O} ${PKG_G}
- fi
- removef HylaFAX ${libdatadir}/faxcover.ps.dist
- if test -f ${spooldir}/etc/cover.templ
- then
- mv ${spooldir}/etc/cover.templ.dist ${spooldir}/etc/cover.templ.N
- installf HylaFAX ${spooldir}/etc/cover.templ.N f 0644 ${PKG_O} ${PKG_G}
- else
- mv ${spooldir}/etc/cover.templ.dist ${spooldir}/etc/cover.templ
- installf HylaFAX ${spooldir}/etc/cover.templ f 0644 ${PKG_O} ${PKG_G}
- fi
- removef HylaFAX ${spooldir}/etc/cover.templ.dist
- # no update
- test -f ${libdatadir}/hfaxd.conf || {
- mv ${libdatadir}/hfaxd.conf.dist ${libdatadir}/hfaxd.conf
- installf HylaFAX ${libdatadir}/hfaxd.conf f 0644 ${PKG_O} ${PKG_G}
- }
- removef HylaFAX ${libdatadir}/hfaxd.conf.dist
- for i in etc/xferfaxlog etc/hosts.hfaxd etc/lutRS18.pcf
- do
- test -f ${spooldir}/${i} || {
- mv ${spooldir}/${i}.dist ${spooldir}/${i}
- case $i in
- etc/hosts.hfaxd)
- installf HylaFAX ${spooldir}/${i} f 0600 ${FAX_U} ${FAX_G}
- ;;
- *)
- installf HylaFAX ${spooldir}/${i} f 0644 ${FAX_U} ${FAX_G}
- ;;
- esac
- }
- removef HylaFAX ${spooldir}/${i}.dist
- done
- # update software database
- installf -f HylaFAX
- removef -f HylaFAX
- if test -d ${spooldir}/recvq
- then
- echo "nnRun ${sbindir}/faxsetupn"
- cat >/tmp/root.crontab <<EOF
- # crontab(1)
- # (minutes) (hour) (day of the month) (month of the year) (day of the week)
- # faxqclean - HylaFAX queue cleaner process
- 0 0 * * * ${sbindir}/faxqclean
- EOF
- cat >/tmp/uucp.crontab <<EOF
- # crontab(1)
- # (minutes) (hour) (day of the month) (month of the year) (day of the week)
- # faxcron - HylaFAX routine maintenance script
- 25 23 * * 0 ${sbindir}/faxcron -rcv 20 | mailx -s "Fax Reports" FaxMaster
- EOF
- echo "See sample crontab(1) entries for root and fax (uucp)"
- echo "/tmp/root.crontab"
- echo "/tmp/uucp.crontab"
- else
- echo "nnRun ${sbindir}/faxsetup -clientn"
- fi
- exit 0