mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-13 23:36:08 +00:00
649d8f8c94
- Added etc/setiathome.conf with options to set the nice level, the max. number of processes to run, the working directory, and the the user id to run as. - setiathome.1 was missing from Makefile (and +CONTENTS subsequently) - Updated the man page to reflect the changes.
68 lines
2.1 KiB
Bash
68 lines
2.1 KiB
Bash
#!/bin/sh
|
|
|
|
#
|
|
# Set up the work area and run setiathome to login or register
|
|
#
|
|
|
|
DBDIR=/var/db/setiathome
|
|
RCD=${PKG_PREFIX}/etc/rc.d/setiathome.sh
|
|
seti_wrkdir=/var/db/setiathome # working directory
|
|
seti_user=nobody # user id to run under
|
|
seti_nice=1 # nice level to run at
|
|
seti_maxprocs=`sysctl -n hw.ncpu` # max. number of processes to start
|
|
|
|
if [ -f ${PKG_PREFIX}/etc/setiathome.conf ]; then
|
|
. ${PKG_PREFIX}/etc/setiathome.conf
|
|
fi
|
|
|
|
case $2 in
|
|
POST-INSTALL)
|
|
if [ -n "${PACKAGE_BUILDING}" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo "**** setihome requires a working directory for temporary files and"
|
|
echo " a brief registration process."
|
|
echo
|
|
echo " Would you like to set up a working directory in ${DBDIR},"
|
|
if [ ${seti_maxprocs} -gt 1 ]; then
|
|
if [ `sysctl -n hw.ncpu` -eq ${seti_maxprocs} ]; then
|
|
echo " register with SETI@home, and let me arrange for ${seti_maxprocs} setiathome"
|
|
echo " processes (one for each of your `sysctl -n hw.ncpu` CPUs) to be started automatically"
|
|
echo -n " as user \`${seti_user}' [Y/n]? "
|
|
else
|
|
echo " register with SETI@home, and let me arrange for ${seti_maxprocs} setiathome"
|
|
echo " processes (as configured) to be started automatically"
|
|
echo -n " as user \`${seti_user}' [Y/n]? "
|
|
fi
|
|
else
|
|
echo " register with SETI@home, and let me arrange for setiathome to be"
|
|
echo -n " started automatically as user \`${seti_user}' [Y/n]? "
|
|
fi
|
|
read a
|
|
echo ""
|
|
if [ "X$a" = "XN" -o "X$a" = "Xn" ]; then
|
|
echo ""
|
|
echo "Please set up the working directory yourself. You can use"
|
|
echo "${RCD} register"
|
|
echo "to do so. See setiathome(1) for details."
|
|
exit 0
|
|
fi
|
|
|
|
${RCD} register
|
|
|
|
if [ ! -f ${DBDIR}/user_info.txt ]; then
|
|
echo "unable to start setiathome: it seems registration or login failed."
|
|
exit 0
|
|
fi
|
|
${RCD} start >/dev/null
|
|
echo
|
|
echo "**** Congratulations! Your system now participates in the search for extra-"
|
|
echo " terrestrial intelligence. Be sure to visit the home page at"
|
|
echo " http://setiathome.ssl.berkeley.edu/"
|
|
echo " See setiathome(1) for further details."
|
|
;;
|
|
|
|
esac
|
|
exit 0
|