Thursday, 4 June 2015

How to ifconfig downup a list of IP's

#!/usr/local/bin/php  -q
<?php
        error_reporting(1023);
        $file  =  file( "MyFile");
        for($i=0 ; $i < count($file) ; $i++)    {
          $file[$i]=ereg_replace("[\n]","",$file[$i]);
          echo"ifconfig $file[$i] down\n";
          exec("ifconfig $file[$i] down\n");
          echo"ifconfig $file[$i] up\n";
          exec("ifconfig $file[$i] up\n");

        }
?>

0 comments:

Post a Comment