updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / foldingathome-gpu-nvidia / foldingathome-gpu.install
blob5b95c2f5c0f7362a1385540ead0ad69d299a159e
1 function create_links(){
2 cd /opt/fah-gpu/alpha && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
3 cd /opt/fah-gpu/bravo && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
4 cd /opt/fah-gpu/charlie && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
5 cd /opt/fah-gpu/delta && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
6 cd /opt/fah-gpu/echo && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
7 cd /opt/fah-gpu/foxtrot && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
8 cd /opt/fah-gpu/golf && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
9 cd /opt/fah-gpu/hotel && ln -s /opt/fah-gpu/nvcuda.dll ./nvcuda.dll
11 pre_install(){
12 PID=`pidof -o %PPID Folding@home-Win32-gpu.exe`
13 if [ ! -z "$PID" ]; then
14 echo "You have the GPU client running!"
15 echo "Stopping GPU client before upgrade."
16 /etc/rc.d/foldingathome-gpu stop
19 post_install() {
20  create_links
22 post_upgrade(){
23 if [ -f /opt/fah-gpu/client.cfg ]; then
24   echo "Converting your setup to allow multi-gpu"
25   cd /opt/fah-gpu
26   mv ./work ./*.txt ./FahCore*.exe ./MyFolding.html ./client.cfg ./queue.dat /opt/fah-gpu/alpha/
27   echo "Move complete, your client files have been moved to"
28   echo "/opt/fah-gpu/alpha adjust fah-mon accordingly"
29 else
30  echo "Your system is already setup for multi-gpu"
32 if [ -f /opt/fah-gpu/alpha/nvcuda.dll ]; then
33  /bin/true
34 else
35  create_links
38 post_remove(){
39 echo "Would you like to delete the folder /opt/fah-gpu"
40 echo "and ALL its contents? y/n"
41 read answer
42 if [ $answer == y ]; then
43 rm -rf /opt/fah-gpu
44 else
45 echo "You answered n, leaving folder /opt/fah-gpu"