Sophie

Sophie

distrib > PLD > ra > i686 > media > dist > by-pkgid > e23f8e569918080c452032d2942eb6f3 > scriptlet

inn-2.3.2-10.i686.rpm

PREUN

/bin/sh
if [ "$1" = "0" ]; then
	if [ -f /var/lock/subsys/news ]; then
		/etc/rc.d/init.d/inn stop
	fi
	/sbin/chkconfig --del inn
fi

POSTIN

/bin/sh
if [ -f /var/lib/news/history ]; then
	cd /var/lib/news
	/usr/bin/makedbz -s `wc -l <history` -f history
	for i in dir hash index pag; do
		[ -f history.n.$i ] && mv history.n.$i history.$i
	done
	chown news.news history.*
	chmod 644 history.*
else
	cd /var/lib/news
	cp /dev/null history
	/usr/bin/makehistory
	/usr/bin/makedbz -s `wc -l <history` -f history
	for i in dir hash index pag; do
		[ -f history.n.$i ] && mv history.n.$i history.$i
	done
	chown news.news history history.*
	chmod 644 history history.*
fi
[ -f /var/lib/news/active.times ] || {
	touch /var/lib/news/active.times
	chown news.news /var/lib/news/active.times
}

[ -f /var/log/news/news.notice ] || {
	touch /var/log/news/news.notice
	chown news.news /var/log/news/news.notice
	chmod 664 /var/log/news/news.notice
}

[ -f /var/log/news/news.crit ] || {
	touch /var/log/news/news.crit
	chown news.news /var/log/news/news.crit
	chmod 660 /var/log/news/news.crit
}

[ -f /var/log/news/news.err ] || {
	touch /var/log/news/news.err
	chown news.news /var/log/news/news.err
	chmod 660 /var/log/news/news.err
}

[ -f /var/lib/news/.news.daily ] || {
	touch /var/lib/news/.news.daily
	chown news.news /var/lib/news/.news.daily
	chmod 664 /var/lib/news/.news.daily
}

if [ -f /etc/syslog.conf ]; then
  if ! grep -q INN /etc/syslog.conf; then
    sed 's/mail.none;/mail.none;news.none;/' < /etc/syslog.conf > /etc/syslog.conf.inn
    mv -f /etc/syslog.conf.inn /etc/syslog.conf
    echo ''										>> /etc/syslog.conf
    echo '#'										>> /etc/syslog.conf
    echo '# INN'									>> /etc/syslog.conf
    echo '#' 										>> /etc/syslog.conf
    echo 'news.=crit                                        /var/log/news/news.crit'	>> /etc/syslog.conf
    echo 'news.=err                                         /var/log/news/news.err'	>> /etc/syslog.conf
    echo 'news.notice                                       /var/log/news/news.notice'	>> /etc/syslog.conf
    fi
  if [ -f /var/run/syslog.pid ]; then
    kill -HUP `cat /var/run/syslog.pid` 2> /dev/null ||:
  fi
else
    # syslog.conf does not exist
    echo "mail.none /var/log/messages" 							> /etc/syslog.conf.inn
    echo "" 										>> /etc/syslog.conf.inn
    echo "# INN" 									>> /etc/syslog.conf.inn
    echo "news.=crit                                      /var/log/news/news.crit"	>> /etc/syslog.conf.inn
    echo "news.=err                                       /var/log/news/news.err"	>> /etc/syslog.conf.inn
    echo "news.notice                                     /var/log/news/news.notice"	>> /etc/syslog.conf.inn
fi

/sbin/chkconfig --add inn
if [ -f /var/lock/subsys/inn ]; then
	/etc/rc.d/init.d/inn restart >&2
else
	echo "Run \"/etc/rc.d/init.d/inn start\" to start inn news server." >&2
fi