User Control Panel
Advertisements

HELP US, HELP YOU!

Linux shell script

 
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions
View unanswered posts
Author Message
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Tue Apr 19, 2005 9:42 am    Post subject: Reply with quote

When i ran my bot on windows i had it running in a batch loop.

Now i have it running (using screen) on a linux server. I need a similar loop, lest it crashes.


Can anyone explain how to do this in nix?

thanks

draget
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Tue Apr 19, 2005 2:09 pm    Post subject: Reply with quote

By DOS loop, do you mean something equivalent to this?
Code:
Loop:<br />perl bot.pl<br />goto Loop


Or do you mean a loop inside the Perl code, or what?

The first one (batch file loops) doesn't have much effect on the bot's ability to run, it just will restart the bot if it happens to crash. If your Linux bot is crashing, then all a looping shell script would do is keep restarting it, only to let it crash again.

So we need more information. :rolleyes:

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Tue Apr 19, 2005 2:12 pm    Post subject: Reply with quote

QUOTE(Cer @ Apr 19 2005, 06:09 AM)
By DOS loop, do you mean something equivalent to this?
Code:
Loop:<br />perl bot.pl<br />goto Loop



Exactly that, but for linux!
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Tue Apr 19, 2005 3:09 pm    Post subject: Reply with quote

That will constantly run the bot

To run it in the background use:

Quote:
nohup perl bot.pl &
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Wed Apr 20, 2005 1:27 am    Post subject: Reply with quote

dont like nohup, i use screen and just need a shell script similar to the above, but I dont know linux very well Sad
Back to top
malefactor
Member
Member


Joined: 27 Jan 2005
Posts: 109
Location: Lewiston, ME
Reputation: 17.7Reputation: 17.7

PostPosted: Wed Apr 20, 2005 1:37 am    Post subject: Reply with quote

you should google "linux shell script"
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Wed Apr 20, 2005 2:17 am    Post subject: Reply with quote

i have tried, i'll have to keep on trying!
Back to top
malefactor
Member
Member


Joined: 27 Jan 2005
Posts: 109
Location: Lewiston, ME
Reputation: 17.7Reputation: 17.7

PostPosted: Wed Apr 20, 2005 2:56 am    Post subject: Reply with quote

QUOTE(draget @ Apr 19 2005, 06:17 PM)
i have tried, i'll have to keep on trying!
[right][snapback]47872[/snapback][/right]


Sad sorry... I ran it just to see and came up with quite a few sites...
But I didn't want to just post some code and say try this cuz I have no linux machine to test it on.
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Thu Apr 21, 2005 3:11 am    Post subject: Reply with quote

tried this:

Code:
#!/bin/bash  <br /> <br />while [ 1 ] <br /> <br />do <br /> <br />    perl bot.pl <br />    sleep 5 <br /> <br />done


and got this:

Quote:
-bash-2.05b$ dir
BLOCKAGE.dat  etc     Lib   message.pl  SARG.dat vortex.jpg
bot.pl   FILES   Logs  Replies     Settings.dat
Commands images  Mail  runbot Store
-bash-2.05b$ ./runbot
: No such file or directory
-bash-2.05b$


Sad
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Thu Apr 21, 2005 12:06 pm    Post subject: Reply with quote

i dont want to use nohup Razz
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Thu Apr 21, 2005 2:59 pm    Post subject: Reply with quote

Why dont you whats so bad about it?
Back to top
Addict
Not Yet a God
Not Yet a God


Joined: 21 Jan 2004
Posts: 473

Reputation: 34.4Reputation: 34.4Reputation: 34.4

PostPosted: Thu Apr 21, 2005 8:50 pm    Post subject: Reply with quote

Just do:
Code:
perl bot.pl &
then....
Back to top
alienz
Almost An Agent
Almost An Agent


Joined: 22 Mar 2004
Posts: 1436
Location: Mars
Reputation: 55.7

PostPosted: Fri Apr 22, 2005 3:15 am    Post subject: Reply with quote

God you people are dense...

http://www.linux.com/guides/abs-guide/dosbatch.shtml

_________________
Check out Botworld! A dev resource for things bot.
Downloads, articles, news, fourm and more.
http://botworld.marzopolis.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> General Programming Questions All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group