Wilders Security Forums  

Go Back   Wilders Security Forums > Software, Hardware and General Services > all things UNIX
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread
  #1  
Old May 27th, 2011, 09:53 AM
Becho's Avatar
Becho Becho is offline
Infrequent Poster
 
Join Date: Oct 2007
Posts: 26
Default Shutdown PC after f@h work-unit is done

Hello all again. I am participating in running F@H & I would like some help on how to add to my script a command to shut down the pc once the work-unit is done. I have F@H installed under my /home directory and use a script that runs in a terminal window. When the unit is done it automatically closes the terminal but I would also like it to shut down the pc. I run Xubuntu 11.04 64-bit. Here is the script:

Code:
#!/bin/bash cd Folding ./fah6 -oneunit -verbosity 9

I google'd but to no avail.
  #2  
Old May 27th, 2011, 02:08 PM
Mrkvonic Mrkvonic is offline
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,428
Default Re: Shutdown PC after f@h work-unit is done

There are many options.

First you can add a shutdown command at the end of that script, provided fah runs in foreground. Second, you can create a symbolic link when that script starts and delete it when it adds, then have cron run every minute or so a script that check for the existence of the link; if it's there, don't shutdown and vice versa.

And many others. But the way you describe it, adding a shutdown option at the end would work great.

Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
  #3  
Old May 27th, 2011, 03:56 PM
Becho's Avatar
Becho Becho is offline
Infrequent Poster
 
Join Date: Oct 2007
Posts: 26
Default Re: Shutdown PC after f@h work-unit is done

Which command should I use?
Code:
&& shutdown -f now
Wouldn't that start the script and shut down the pc as soon as I click it. Also that would need root access? Thank you for the tips.
__________________
Xubuntu 11.04 64-Bit
E6750@3.3
4GB OCZ DDR2
Sapphire 4850 HD
WD 320 Sata 3.0
XFI XtremeGamer
  #4  
Old May 27th, 2011, 04:44 PM
Mrkvonic Mrkvonic is offline
Linux Systems Expert
 
Join Date: May 2005
Posts: 7,428
Default Re: Shutdown PC after f@h work-unit is done

I meant in the bash script, add another line that reads shutdown <options>.
You can test with echo "shutdown" to make sure the command is not executed too early.
Mrk
__________________
http://www.dedoimedo.com

All your base are belong to us

Linux Systems Expert / Systems Programmer, Linux System Administrator, LPIC-1, LPIC-2 (WIP), GSEC, CCHD, CCHA
 

Wilders Security Forums > Software, Hardware and General Services > all things UNIX « Previous Thread | Next Thread »

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Settings
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:14 AM.


Powered by vBulletin® Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2013, Wilders Security Forums