⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 restart.lua.svn-base

📁 嵌入式无线路由系统openwrt的web配置工具
💻 SVN-BASE
字号:
#!/usr/bin/lua-- Copyright (C) 2008 OpenRB.comrequire('fslib')data = datajson()-- config name must be suppliedif (data ~= nil and data['id'] ~= nil) then  cfgname = data['id']  cfg = uci.get_all('network', cfgname)  if (cfg['type'] == 'bridge') then    ifname = 'br-' .. cfgname    forcedown = true  else    ifname = cfg['ifname']  end  -- interface found, check if it's up  if (ifname ~= nil) then    ifstats = proc('if-json -s')        -- interface is up, restart it    if (ifstats[ ifname ] == 1) then      if (forcedown) then        os.execute('ifdown ' .. cfgname)      end      os.execute('ifup ' .. cfgname)      -- has wireless, restart it aswell      if (cfgname:find('^wifi')) then        os.execute('wifi ' .. cfgname)      end    end  endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -