| View previous topic :: View next topic |
| Author |
Message |
matthew.a.squires
Joined: 03 Jul 2008 Posts: 89
|
Posted: Wed Jan 18, 2012 8:24 pm Post subject: Script to schedule the Disableing & Enableing ETH Port? |
|
|
Is it possible to schedule an Ethernet Port to be Disable and Enable at certain times via a Script.
For example: Eth01 is Disabled at 11pm & Eth01 is Enabled at 6am.
I am not a Linux Admin and I have no idea who to write the Script. Any and All assistance is greatly appreciated. _________________ Thank You;
Matthew Squires |
|
| Back to top |
|
 |
redfive
Joined: 27 Aug 2009 Posts: 71
|
Posted: Wed Jan 18, 2012 9:22 pm Post subject: |
|
|
Of course , is very simple , u have to create two jobs , System>Startup/Cron>Add Job | Code: | ifconfig ETH01 down
| bottom of page , Jobs Scheduling , Hour 23 , Minute 00 , Day ........then enable the job and save .
Same as above butHour 06 , Minute 00 , Day .......
cheers
jonatha |
|
| Back to top |
|
 |
matthew.a.squires
Joined: 03 Jul 2008 Posts: 89
|
Posted: Wed Jan 18, 2012 9:47 pm Post subject: |
|
|
Thanks Redfive. I will configure it tonight. _________________ Thank You;
Matthew Squires |
|
| Back to top |
|
 |
matthew.a.squires
Joined: 03 Jul 2008 Posts: 89
|
Posted: Thu Jan 19, 2012 3:51 am Post subject: |
|
|
Redfive, it worked beautifully, but I ran into one problem. I had to refresh the DHCP on the port to get the IP Address.
I tried waiting but it did not work.
Do you mind assisting me with the command to refreshing the DHCP, so that I can place it below the command to bring Up the ETH port?
And can a timer be included, for instance; 5 seconds after the port is UP.
Or a separate CRON Job that I can run 1 minute after bringing the ETH port UP? _________________ Thank You;
Matthew Squires |
|
| Back to top |
|
 |
redfive
Joined: 27 Aug 2009 Posts: 71
|
Posted: Thu Jan 19, 2012 9:21 pm Post subject: |
|
|
change the 1st previous jobs withand the 2ndthe first , will release the ip address from the interface , the second starts the dhcp discover process . should works...
bye
jonatha |
|
| Back to top |
|
 |
JC
Joined: 21 Apr 2008 Posts: 89
|
Posted: Sun Jan 22, 2012 4:57 am Post subject: |
|
|
this is so funny, not two weeks ago i implemented the exact same thing, was about to post a 'what am I doing wrong?' when I realized i needed the full command path for it to work
| Code: | | /sbin/ifconfig ETH00 down |
Might I suggest you try a static IP on your interfaces (on the setup - network page) to lessen the need to renew dhcp requests.
JC |
|
| Back to top |
|
 |
|