#!/bin/bash # folding@home installer for hostgator.com # author : Ford Merrill FOLDING="FAH6.02beta1-Linux.tgz" URL="http://www.stanford.edu/group/pandegroup/folding/release/" BINARY="fah6" # remove old user and kill procs pkill -9 -u folding rm -rf /usr/local/folding # generate a 50 character random password for the user folding : PASS=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?"|fold -w 50| head -n1` # create the user folding and /usr/local/folding as it's home : useradd -d /usr/local/folding -s /bin/bash -p $PASS folding mkdir /usr/local/folding; chown folding.folding /usr/local/folding # grab the folding client and the client config and set proper permissions : wget -O /usr/local/folding/$FOLDING $URL/$FOLDING chown folding:folding /usr/local/folding/$FOLDING cd /usr/local/folding && tar -xvzf $FOLDING chown folding.folding -R /usr/local/folding chmod u+x /usr/local/folding/$FOLDING wget -O /usr/local/folding/client.cfg http://toolbox.hostgator.com/folding/client.cfg chown folding:folding /usr/local/folding/client.cfg # make sure it starts at rc.local echo "cd /usr/local/folding; sudo -b -u folding ./$BINARY" >> /etc/rc.local # go ahead and start it up cd /usr/local/folding sudo -b -u folding ./$BINARY &