Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

create bash on Linux VPS that will open and close firefox every X sec (like bat file on windows

asrafedenasrafeden Member
edited December 2015 in Help

create bash file/ script on Linux VPS that will open and close firefox every X sec (3600 sec +-) + run imacro file like bat file on windows.
how can i do it?
thanks for help all!

Comments

  • While loop + sleep. Why do you need to do this?

  • jlayjlay Member
    edited December 2015

    Here you go:

    while true ; do sleep 3600 ; echo "starting firefox" ; firefox ; done

    It's crude and only opens firefox every 3,600 seconds. You can add 'killall firefox' if you want to do housecleaning and get rid of existing instances before starting a new one. That would look something like this:

    while true ; do sleep 3600 ; echo "killing existing firefox instances" ; killall firefox ; echo "starting firefox" ; firefox ; done

    I haven't really tested this but let me know if it works as intended.

  • Since you just edited.. If you need ~ 3600sec, you can also use cron? Run hourly and done.

  • asrafedenasrafeden Member
    edited December 2015

    @TheOnlyDK said:
    While loop + sleep. Why do you need to do this?

    thanks but how its works? i never use Linux... i edit my post... i need it to run imacro.

    @tehmaggot said:
    Here you go:

    while true ; do sleep 5 ; echo "starting firefox" ; firefox ; done

    It's crude and only opens firefox every five seconds. You can add 'killall firefox' if you want to do housecleaning and get rid of existing instances before starting a new one. That would look something like this:

    while true ; do sleep 5 ; echo "killing existing firefox instances" ; killall firefox ; echo "starting firefox" ; firefox ; done

    I haven't really tested this but let me know if it works as intended.

    i edit my post, i need it to run imacro when its open firefox...
    can you tell me how its works?
    for example on windows i do that do open and close firefox + run imacro:
    1. create fill (Notepad) and write that:
    @echo off
    :loop
    cls
    taskkill /F /IM Firefox.exe
    cls
    taskkill /F /IM crashreporter.exe
    cls
    ping 192.0.2.2 -n 1 -w 4000 > nul
    set MOZ_NO_REMOTE=1
    start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -p firefox imacros://run/?m=XXXXX.iim
    ping 192.0.2.2 -n 1 -w 30000 > nul
    set MOZ_NO_REMOTE=
    ping 192.0.2.2 -n 1 -w 1200000 > nul
    goto loop

    http://prntscr.com/99xs9e

    1. save as a XXX.bat and run.

    how its works on linux?

  • netomxnetomx Moderator, Veteran

    Ot is obviously why he needs it

  • @asrafeden said:
    how its works on linux?

    Sadly I'm not familiar with iMacro or how Windows scripts work, so I can't even confidently guess. Hopefully somebody else can help you out there!

  • Use crontab, something like:

          • 10killall -9 firefox ; sleep 5 ;firefox url.com
  • raindog308raindog308 Administrator, Veteran

    linuxthefish said: Use crontab, something like:

    10killall -9 firefox ; sleep 5 ;firefox url.com

    You'd probably need to set DISPLAY to launch firefox.

    Why do I suspect the OP is engineering some sort of crappy ad-revenue-traffic-generating lameness...

  • raindog308 said: Why do I suspect the OP is engineering some sort of crappy ad-revenue-traffic-generating lameness...

    That's what I thought too.

Sign In or Register to comment.