Ask Your Question
2

Simple terminal commands help

asked 2014-08-03 11:24:54 -0500

reginolda gravatar image

updated 2014-09-28 15:28:01 -0500

mether gravatar image

Hi All,

I was a traditional Windows XP user and I have an Internet connection which is free during night 2:00Am to Morning 8:00 AM.

When I was using Windows XP I just used three batch files to achieve the below workflow.

1 Wake up a hibernated Windows XP machine @ 2:00AM 2. Connect to internet. @ 2:05 AM 3. Start downloads which are setup in Utorrent/ flashget. 4. Disconnect internet connection @ 7:55AM 5 Shutdown PC at 8:Am

Is it possible to achieve this is in Fedora 20? I am totally stumped right at the beginning of this workflow, first of all not even able to find out a command to connect to internet in F20.

In Windows XP below will do the trick of connecting to internet

rasdial <connection name=""> <username> <password> </password></username></connection>

and rasdial /disconnect with disconnect the internet connection very simple.

Can some one explain me how to do this in F20? I am using F20 and I really want to do this is F20

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2014-08-03 23:54:35 -0500

abadrinath gravatar image

Firstly, create a file named script2.sh in $HOME/scripts using mkdir -p $HOME/scripts; touch script2.sh. Execute this in a terminal.

After you have executed those commands, open the file /home/user/scripts/script2.sh and paste the following contents into it.

#!/bin/bash
#This invokes the bash shell
at 205 -f $HOME/scripts/script.sh #This is for turning on internet at 2:05 :)
#DOWNLOAD WHATEVER YOU WANT using wget
wget whatever_torrent_file
#OR
vuze [...] #This is the open-source torrent client
at 755 -f $HOME/scripts/script3.sh
at 800 -f $HOME/scripts/script4.sh

Next, create the file named /home/user/scripts/script.sh with the following contents:

#!/bin/bash
ifup eth0

After that, create /home/user/scripts/script3.sh with the contents:

#!/bin/bash
ifdown eth0

Last, create /home/user/scripts/script4.sh with the content:

#!/bin/bash
poweroff

Then, do this only once, execute chmod 700 $HOME/scripts/*.

Keep in mind, you have to:

a) Run this script from between 8:00 AM to 2:00 AM (before it's shutdown).

b) Replace user the name of your user.

c) Get the computer on before 2:00 AM.

HTH.

edit flag offensive delete link more

Comments

1

Using touch to create a file then opening the empty file in an editor is doing things the hard way. Just start your editor, put in the needed text and save it and your editor will ask you to name the file. (In some editors you may need to use Save As, to avoid getting stuck with some default name, but there's never any need for the extra step.) HTH, HAND.

sideburns gravatar imagesideburns ( 2014-08-04 14:03:22 -0500 )edit

True, just did it to avoid the name issue, might just throw it in with the rest of the commands.

abadrinath gravatar imageabadrinath ( 2014-08-05 01:21:34 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2014-08-03 11:24:54 -0500

Seen: 344 times

Last updated: Aug 03 '14