Jump to content

Write me a simple linux script. Get some AAA Steam games!


ViTALiTY

Recommended Posts

So, I need to have a script (I was recommended to use "at") that has to do the following commands:


Command 1, Command 2, Command 3, Command 4, and Command 5.


Command 1 is executed for 12 minutes. Then, it stops.


Right after, Command 2, 3, 4 and 5 are executed for 10 minutes. Then, they stop.


Command 1 is executed again for 12 minutes. Then, stop it.


Commands 2, 3, 4 and 5 are executed again for 10 minutes, WITH a minor switch in one of the switches. Then, they stop.


Repeat everything above.


If you think you can do this, hit me a PM. It's related to reaver and mdk3, so it's not that hard, I just don't know how to do it.


I am willing to offer two (or more) of these Steam games:


Call of Duty: Black Ops


GRID 2


THIEF


Payday 2


The Elder Scrolls V: Skyrim Legendary Edition


Far Cry 3


Assassin's Creed IV Black Flag


Goat Simulator


Dishonored GOTY


Thanks in advance!

Link to comment
Share on other sites

Let's not even bother with at. And you can keep your games, I don't play any. :)

#!/bin/bash
Command 1 &
sleep 720 # 720 seconds = 12 minutes
killall Command 1
 
Command 2 &
Command 3 &
Command 4 &
sleep 600 # 600 seconds = 10 minutes
killall Command 2
killall Command 3
killall Command 4
 
while true
do
    Command 1 &
    sleep 720 # 720 seconds = 12 minutes
    killall Command 1
    Command 2 variant &
    Command 3 variant &
    Command 4 variant &
    sleep 600 # 600 seconds = 10 minutes
    killall Command 2 variant
    killall Command 3 variant
    killall Command 4 variant
done
Link to comment
Share on other sites

THANKS! Deeply appreciated mate!

Now, I didn't really want to bother you anymore with this, but it seems I am doing something wrong.

Basically, here's the thing. I want to crack a friend's WPS router. But it locks me out every 10 tries. So I have to MDK3 the router until it reboots. After the router reboots, it changes the channel. It alternates between channel 6 and channel 1.

I changed the script to my needs:

http://pastebin.com/3uHWm0QT

Then I SSH'd into the pineapple, SCPd the file to it and:

http://pastebin.com/LwVtfMDr

And that happens...

Edited by ViTALiTY
Link to comment
Share on other sites

Replace /bin/bash on the first line with /bin/sh and make sure you don't have Windows line breaks at the end (though I think scp handles that for you).

Edited by Cooper
Link to comment
Share on other sites

This is a better way. Killall can be a very blunt instrument. If you can know the PIDs, you should just kill them directly.

#!/bin/bash
Command 1 &
C1=$!
sleep 720 # 720 seconds = 12 minutes
kill -9 $C1
 
Command 2 &
C2=$!
Command 3 &
C3=$!
Command 4 &
C4=$!
sleep 600 # 600 seconds = 10 minutes
kill -9 $C2 $C3 $C4
 
while true
do
    Command 1 &
    C1=$!
    sleep 720 # 720 seconds = 12 minutes
    kill -9 $C1
    Command 2 variant &
    C2=$!
    Command 3 variant &
    C3=$!
    Command 4 variant &
    C4=$!
    sleep 600 # 600 seconds = 10 minutes
    kill -9 $C2 $C3 $C4
done

If you want to get fancy, write a function to abstract it.

#!/bin/bash

function timedRun(){
    TIME=$1
    shift
    $@ &
    PID=$!
    ( sleep $TIME ; kill -9 $PID ) &
}

TIME1=720
TIME2=600

while true
do
    timedRun $TIME1 Command 1
    sleep $TIME1
    
    timedRun $TIME2 Command 2
    timedRun $TIME2 Command 3
    timedRun $TIME2 Command 4
    sleep $TIME2
done
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...