Sophie

Sophie

distrib > Fedora > 20 > x86_64 > by-pkgid > 3059e0df11f89ec4bed7f3cfd6b3572f > scriptlet

freeradius-3.0.3-2.fc20.x86_64.rpm

PREIN

/bin/sh
getent group  radiusd >/dev/null || /usr/sbin/groupadd -r -g 95 radiusd > /dev/null 2>&1
getent passwd radiusd >/dev/null || /usr/sbin/useradd  -r -g radiusd -u 95 -c "radiusd user" -d /var/lib/radiusd -s /sbin/nologin radiusd > /dev/null 2>&1
exit 0

PREUN

/bin/sh

if [ $1 -eq 0 ] ; then 
        # Package removal, not upgrade 
        /usr/bin/systemctl --no-reload disable radiusd.service > /dev/null 2>&1 || : 
        /usr/bin/systemctl stop radiusd.service > /dev/null 2>&1 || : 
fi

POSTIN

/bin/sh

if [ $1 -eq 1 ] ; then 
        # Initial installation 
        /usr/bin/systemctl preset radiusd.service >/dev/null 2>&1 || : 
fi 
if [ $1 -eq 1 ]; then           # install
  # Initial installation
  if [ ! -e /etc/raddb/certs/server.pem ]; then
    /sbin/runuser -g radiusd -c 'umask 007; /etc/raddb/certs/bootstrap' > /dev/null 2>&1
  fi
fi
exit 0

POSTUN

/bin/sh

/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : 
if [ $1 -ge 1 ] ; then 
        # Package upgrade, not uninstall 
        /usr/bin/systemctl try-restart radiusd.service >/dev/null 2>&1 || : 
fi 
if [ $1 -eq 0 ]; then           # uninstall
  getent passwd radiusd >/dev/null && /usr/sbin/userdel  radiusd > /dev/null 2>&1
  getent group  radiusd >/dev/null && /usr/sbin/groupdel radiusd > /dev/null 2>&1
fi
exit 0

/bin/systemctl try-restart radiusd.service >/dev/null 2>&1 || :