2005-10-04 17:54:23 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "$2" = PRE-INSTALL ]; then
|
|
|
|
user=fcron
|
|
|
|
group=fcron
|
2006-02-09 10:28:29 +00:00
|
|
|
uid=247
|
|
|
|
gid=247
|
2005-10-04 17:54:23 +00:00
|
|
|
|
|
|
|
if /usr/sbin/pw groupshow $group 2>/dev/null; then
|
|
|
|
echo "Using already existing group \"$group\"."
|
|
|
|
else
|
2006-02-09 10:28:29 +00:00
|
|
|
if /usr/sbin/pw groupadd $group -g $gid; then
|
2005-10-04 17:54:23 +00:00
|
|
|
echo "Added group \"$group\"."
|
|
|
|
else
|
|
|
|
echo "Unable to add group \"$group\"."
|
|
|
|
echo "Please create it manually and try again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if /usr/sbin/pw usershow $user 2>/dev/null; then
|
|
|
|
echo "Using already existing user \"$user\"."
|
|
|
|
else
|
2007-01-17 07:30:11 +00:00
|
|
|
if /usr/sbin/pw useradd $user -u $uid -g $group -s /sbin/nologin -c "fcron pseudo-user"; then
|
2005-10-04 17:54:23 +00:00
|
|
|
echo "Added user \"$user\"."
|
|
|
|
else
|
|
|
|
echo "Unable to add user \"$user\"."
|
|
|
|
echo "Please create it manually and try again."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
elif [ "$2" = POST-INSTALL ]; then
|
|
|
|
/usr/bin/install -o fcron -g fcron -m 770 -d /var/spool/fcron
|
|
|
|
|
|
|
|
for f in fcron.allow fcron.conf fcron.deny; do
|
2005-10-30 17:23:50 +00:00
|
|
|
if ! [ -e $PKG_PREFIX/etc/$f ]; then
|
|
|
|
/usr/bin/install -o root -g fcron -m 640 \
|
|
|
|
$PKG_PREFIX/etc/$f.dist $PKG_PREFIX/etc/$f
|
|
|
|
fi
|
2005-10-04 17:54:23 +00:00
|
|
|
done
|
|
|
|
fi
|