Advertisement
niammuddin

api mikrotik codeigniter

Oct 30th, 2020
2,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1.         // $this->db->select('ip');
  2.         // $query = $this->db->get('ip_server1')->result_array();
  3.  
  4.         // $prefix = array();
  5.         // foreach ($query as $value) {
  6.         //     $prefix[] = $value['ip'];
  7.         // }
  8.  
  9.         // // print_r($prefix);
  10.  
  11.         // while (in_array(($lastip = rand(10, 13)), $prefix));
  12.  
  13.         // $ip = '172.16.1.' . $lastip;
  14.  
  15.         // echo $ip;
  16.  
  17.         // $hostname = '192.168.1.1';
  18.         // $username = '1234';
  19.         // $password = '1234';
  20.  
  21.         // if ($this->routerosapi->connect($hostname, $username, $password)) {
  22.  
  23.         //     // get informastion from mikrotik before create users ppp
  24.         //     $this->routerosapi->write('/ppp/secret/print', false);
  25.         //     $this->routerosapi->write('=.proplist=remote-address');
  26.         //     $iplist = $this->routerosapi->read();
  27.         //     $this->routerosapi->disconnect();
  28.  
  29.         //     $prefix = array();
  30.         //     foreach ($iplist as $value) {
  31.         //         $data = $value['remote-address'];
  32.         //         $split = explode('.', $data);
  33.         //         $prefix[] = @$split[3];
  34.         //     }
  35.         //     print_r($prefix);
  36.         // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement