PREIN
/bin/sh
# Check now if there is an old ( < 1.1.x ) version of fcrontab on the system.
echo `fcron -V 2>&1 | grep "^fcron "` > /tmp/PREVIOUS_VERSION
if [ "$1" = "1" ]; then
/usr/share/rpm-helper/add-user fcron $1 fcron /var/spool/fcron /bin/true
fi
PREUN
/bin/sh
/usr/share/rpm-helper/del-service fcron $1 fcron
POSTIN
/bin/sh
if [ "$1" = "2" ]; then
killall -TERM fcron
FCRONTABS=/var/spool/fcron
find ${FCRONTABS} -type f \( -name "*.orig" -a ! -name "root.orig" \) \
-exec chown fcron:fcron {} \; -exec chmod 640 {} \;
find ${FCRONTABS} -type f -name "root.orig" -exec chown root:fcron {} \; -exec chmod 600 {} \;
find ${FCRONTABS} -type f ! -name "*.orig" -exec chown root:root {} \; -exec chmod 600 {} \;
[ -f /etc/fcron.deny ] && chown root:fcron /etc/fcron.deny
[ -f /etc/fcron.allow ] && chown root:fcron /etc/fcron.allow
if test -r "/tmp/PREVIOUS_VERSION"; then
MAJOR=`cat /tmp/PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $1}'`
MINOR=`cat /tmp/PREVIOUS_VERSION | awk '{print $2}' | awk -F '.' '{print $2}'`
fi
if test \( "$MAJOR" -lt 1 \) -o \( \( "$MINOR" -lt 1 \) -a "$MAJOR" -eq 1 \); then
for FILE in $FCRONTABS/* ; do \
if test "$FILE" != "$FCRONTABS/*"; then
BASENAME=`basename $FILE` ; \
FCRONTAB=`echo "$BASENAME" | \
sed "s|.*orig|| ; s|fcrontab.sig|| ; s|rm.*||"` ; \
( test ! -z "$FCRONTAB" && convert-fcrontab $FCRONTAB ) \
|| echo -n ""; \
fi
done
fi
fi
/etc/rc.d/init.d/fcron start
/usr/share/rpm-helper/add-service fcron $1 fcron
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
# Remove user fcron
/usr/share/rpm-helper/del-user fcron $1 fcron
fi