瀏覽代碼

getLocalIP: Added macOS support

master
Robin Lohuis 8 年之前
父節點
當前提交
e70e1dd518
共有 1 個檔案被更改,包括 5 行新增1 行删除
  1. +5
    -1
      OOequipment/subfiles/getLocalIP.m

+ 5
- 1
OOequipment/subfiles/getLocalIP.m 查看文件

@@ -9,7 +9,11 @@ function [ ipaddress ] = getLocalIP()
ipaddress = regexp(result,'(?<=\n IPv4 Address[ \.]*: )([0-9]{1,3}\.?){4}','match');
elseif ismac
% Code to run on Mac platform
[status,result]=system('ifconfig');
if ~(status == 0)
error('Failed to find local IP address');
end
ipaddress = regexp(result,'(?<=\n inet )([0-9]{1,3}\.?){4}','match');
elseif isunix
% Code to run on Unix platform
else


Loading…
取消
儲存