1999-04-22 03:44:35 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Set up the work area and run setiathome to login or register
|
|
|
|
#
|
|
|
|
|
2001-01-27 05:40:33 +01:00
|
|
|
seti_rcdir=${PKG_PREFIX}/etc/rc.d # startup directory
|
|
|
|
seti_script=setiathome.sh # startup script
|
1999-05-19 00:40:35 +02:00
|
|
|
seti_wrkdir=/var/db/setiathome # working directory
|
2001-01-27 05:40:33 +01:00
|
|
|
seti_user=nobody # user id to run under
|
1999-05-19 00:40:35 +02:00
|
|
|
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
|
1999-04-22 03:44:35 +02:00
|
|
|
|
|
|
|
case $2 in
|
|
|
|
POST-INSTALL)
|
1999-04-22 14:24:25 +02:00
|
|
|
if [ -n "${PACKAGE_BUILDING}" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
1999-05-19 00:40:35 +02:00
|
|
|
echo "**** setihome requires a working directory for temporary files and"
|
1999-04-22 03:44:35 +02:00
|
|
|
echo " a brief registration process."
|
1999-05-19 00:40:35 +02:00
|
|
|
echo
|
2001-01-27 05:40:33 +01:00
|
|
|
echo " Would you like to set up a working directory in ${seti_wrkdir},"
|
1999-05-19 00:40:35 +02:00
|
|
|
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
|
1999-04-22 03:44:35 +02:00
|
|
|
read a
|
|
|
|
echo ""
|
1999-05-19 00:40:35 +02:00
|
|
|
if [ "X$a" = "XN" -o "X$a" = "Xn" ]; then
|
1999-04-22 03:44:35 +02:00
|
|
|
echo ""
|
1999-04-22 14:24:25 +02:00
|
|
|
echo "Please set up the working directory yourself. You can use"
|
2001-01-27 05:40:33 +01:00
|
|
|
echo "${seti_rcdir}/${seti_script} register"
|
1999-04-22 14:24:25 +02:00
|
|
|
echo "to do so. See setiathome(1) for details."
|
1999-04-22 03:44:35 +02:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2001-01-27 05:40:33 +01:00
|
|
|
${seti_rcdir}/${seti_script} register
|
1999-04-22 03:44:35 +02:00
|
|
|
|
2001-01-27 05:40:33 +01:00
|
|
|
if [ ! -f ${seti_wrkdir}/user_info.sah ]; then
|
1999-04-22 03:44:35 +02:00
|
|
|
echo "unable to start setiathome: it seems registration or login failed."
|
1999-04-22 14:24:25 +02:00
|
|
|
exit 0
|
1999-04-22 03:44:35 +02:00
|
|
|
fi
|
2001-01-28 20:48:30 +01:00
|
|
|
${seti_rcdir}/${seti_script} start >/dev/null
|
1999-04-22 03:44:35 +02:00
|
|
|
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
|
1999-05-19 00:40:35 +02:00
|
|
|
exit 0
|