Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > cd11d8cb0500c2a97889d7a004cc99d0 > scriptlet

inn-2.6.3-1.mga7.x86_64.rpm

PREIN

/bin/sh
/usr/share/rpm-helper/add-user inn $1 news /etc/news /usr/sbin/nologin

PREUN

/bin/sh
/usr/share/rpm-helper/del-service inn $1 innd 


if [ $1 = 0 ]; then
    if [ -f /var/lib/news/history.dir ]; then
       rm -f /var/lib/news/history.*
    fi
fi

POSTIN

/bin/sh
/usr/bin/systemd-tmpfiles --create inn.conf 

/usr/share/rpm-helper/add-service inn $1 innd 


umask 002
touch /var/log/news/news.notice
touch /var/log/news/news.crit
touch /var/log/news/news.err
[ -f /var/lib/news/active.times ] || {
    touch /var/lib/news/active.times
    chown news:news /var/lib/news/active.times
}
chown -R news:news /var/log/news*

if [ `hostname -f` ]; then
  if [ `cat /etc/news/inn.conf | grep '^server:' | wc -l` -lt 1 ]; then
    echo "server: `hostname -f`" >> /etc/news/inn.conf
  fi

  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
else
  echo "Network misconfigured, manual setup required..."
fi

POSTUN

/bin/sh
if [ "$1" -ge "1" ]; then
    service innd restart > /dev/null 2>&1
fi