2
0

luci.sys.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <head>
  5. <title>Reference</title>
  6. <link rel="stylesheet" href="../luadoc.css" type="text/css" />
  7. <!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <div id="navigation">
  18. <h1>LuaDoc</h1>
  19. <ul>
  20. <li><a href="../index.html">Index</a></li>
  21. </ul>
  22. <!-- Module list -->
  23. <h1>Modules</h1>
  24. <ul>
  25. <li>
  26. <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
  27. </li>
  28. <li>
  29. <a href="../modules/luci.http.html">luci.http</a>
  30. </li>
  31. <li>
  32. <a href="../modules/luci.http.conditionals.html">luci.http.conditionals</a>
  33. </li>
  34. <li>
  35. <a href="../modules/luci.http.date.html">luci.http.date</a>
  36. </li>
  37. <li>
  38. <a href="../modules/luci.http.mime.html">luci.http.mime</a>
  39. </li>
  40. <li>
  41. <a href="../modules/luci.i18n.html">luci.i18n</a>
  42. </li>
  43. <li>
  44. <a href="../modules/luci.ip.html">luci.ip</a>
  45. </li>
  46. <li>
  47. <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
  48. </li>
  49. <li>
  50. <a href="../modules/luci.json.html">luci.json</a>
  51. </li>
  52. <li>
  53. <a href="../modules/luci.jsonc.html">luci.jsonc</a>
  54. </li>
  55. <li>
  56. <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
  57. </li>
  58. <li>
  59. <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
  60. </li>
  61. <li>
  62. <a href="../modules/luci.model.uci.html">luci.model.uci</a>
  63. </li>
  64. <li>
  65. <a href="../modules/luci.rpcc.html">luci.rpcc</a>
  66. </li>
  67. <li>
  68. <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
  69. </li>
  70. <li><strong>luci.sys</strong></li>
  71. <li>
  72. <a href="../modules/luci.sys.init.html">luci.sys.init</a>
  73. </li>
  74. <li>
  75. <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
  76. </li>
  77. <li>
  78. <a href="../modules/luci.sys.net.html">luci.sys.net</a>
  79. </li>
  80. <li>
  81. <a href="../modules/luci.sys.process.html">luci.sys.process</a>
  82. </li>
  83. <li>
  84. <a href="../modules/luci.sys.user.html">luci.sys.user</a>
  85. </li>
  86. <li>
  87. <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
  88. </li>
  89. <li>
  90. <a href="../modules/luci.util.html">luci.util</a>
  91. </li>
  92. <li>
  93. <a href="../modules/luci.xml.html">luci.xml</a>
  94. </li>
  95. <li>
  96. <a href="../modules/nixio.html">nixio</a>
  97. </li>
  98. <li>
  99. <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
  100. </li>
  101. <li>
  102. <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
  103. </li>
  104. <li>
  105. <a href="../modules/nixio.File.html">nixio.File</a>
  106. </li>
  107. <li>
  108. <a href="../modules/nixio.README.html">nixio.README</a>
  109. </li>
  110. <li>
  111. <a href="../modules/nixio.Socket.html">nixio.Socket</a>
  112. </li>
  113. <li>
  114. <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
  115. </li>
  116. <li>
  117. <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
  118. </li>
  119. <li>
  120. <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
  121. </li>
  122. <li>
  123. <a href="../modules/nixio.bin.html">nixio.bin</a>
  124. </li>
  125. <li>
  126. <a href="../modules/nixio.bit.html">nixio.bit</a>
  127. </li>
  128. <li>
  129. <a href="../modules/nixio.crypto.html">nixio.crypto</a>
  130. </li>
  131. <li>
  132. <a href="../modules/nixio.fs.html">nixio.fs</a>
  133. </li>
  134. </ul>
  135. <!-- File list -->
  136. </div><!-- id="navigation" -->
  137. <div id="content">
  138. <h1>Class <code>luci.sys</code></h1>
  139. <p></p>
  140. <h2>Functions</h2>
  141. <table class="function_list">
  142. <tr>
  143. <td class="name" nowrap><a href="#call">call</a>&nbsp;(...)</td>
  144. <td class="summary">
  145. Execute a given shell command and return the error code
  146. </td>
  147. </tr>
  148. <tr>
  149. <td class="name" nowrap><a href="#dmesg">dmesg</a>&nbsp;()</td>
  150. <td class="summary">
  151. Retrieves the output of the "dmesg" command.</td>
  152. </tr>
  153. <tr>
  154. <td class="name" nowrap><a href="#exec">exec</a>&nbsp;(command)</td>
  155. <td class="summary">
  156. Execute a given shell command and capture its standard output
  157. </td>
  158. </tr>
  159. <tr>
  160. <td class="name" nowrap><a href="#getenv">getenv</a>&nbsp;(var)</td>
  161. <td class="summary">
  162. Retrieve environment variables.</td>
  163. </tr>
  164. <tr>
  165. <td class="name" nowrap><a href="#hostname">hostname</a>&nbsp;(String)</td>
  166. <td class="summary">
  167. Get or set the current hostname.</td>
  168. </tr>
  169. <tr>
  170. <td class="name" nowrap><a href="#httpget">httpget</a>&nbsp;(url, stream, target)</td>
  171. <td class="summary">
  172. Returns the contents of a documented referred by an URL.</td>
  173. </tr>
  174. <tr>
  175. <td class="name" nowrap><a href="#mounts">mounts</a>&nbsp;()</td>
  176. <td class="summary">
  177. Retrieve information about currently mounted file systems.</td>
  178. </tr>
  179. <tr>
  180. <td class="name" nowrap><a href="#reboot">reboot</a>&nbsp;()</td>
  181. <td class="summary">
  182. Initiate a system reboot.</td>
  183. </tr>
  184. <tr>
  185. <td class="name" nowrap><a href="#syslog">syslog</a>&nbsp;()</td>
  186. <td class="summary">
  187. Retrieves the output of the "logread" command.</td>
  188. </tr>
  189. <tr>
  190. <td class="name" nowrap><a href="#uniqueid">uniqueid</a>&nbsp;(bytes)</td>
  191. <td class="summary">
  192. Generates a random id with specified length.</td>
  193. </tr>
  194. <tr>
  195. <td class="name" nowrap><a href="#uptime">uptime</a>&nbsp;()</td>
  196. <td class="summary">
  197. Returns the current system uptime stats.</td>
  198. </tr>
  199. </table>
  200. <br/>
  201. <br/>
  202. <h2><a name="functions"></a>Functions</h2>
  203. <dl class="function">
  204. <dt><a name="call"></a><strong>call</strong>&nbsp;(...)</dt>
  205. <dd>
  206. Execute a given shell command and return the error code
  207. <h3>Parameters</h3>
  208. <ul>
  209. <li>
  210. ...: Command to call
  211. </li>
  212. </ul>
  213. <h3>Return value:</h3>
  214. Error code of the command
  215. </dd>
  216. <dt><a name="dmesg"></a><strong>dmesg</strong>&nbsp;()</dt>
  217. <dd>
  218. Retrieves the output of the "dmesg" command.
  219. <h3>Return value:</h3>
  220. String containing the current log buffer
  221. </dd>
  222. <dt><a name="exec"></a><strong>exec</strong>&nbsp;(command)</dt>
  223. <dd>
  224. Execute a given shell command and capture its standard output
  225. <h3>Parameters</h3>
  226. <ul>
  227. <li>
  228. command: Command to call
  229. </li>
  230. </ul>
  231. <h3>Return value:</h3>
  232. String containing the return the output of the command
  233. </dd>
  234. <dt><a name="getenv"></a><strong>getenv</strong>&nbsp;(var)</dt>
  235. <dd>
  236. Retrieve environment variables. If no variable is given then a table
  237. containing the whole environment is returned otherwise this function returns
  238. the corresponding string value for the given name or nil if no such variable
  239. exists.
  240. <h3>Parameters</h3>
  241. <ul>
  242. <li>
  243. var: Name of the environment variable to retrieve (optional)
  244. </li>
  245. </ul>
  246. <h3>Return values:</h3>
  247. <ol>
  248. <li>String containing the value of the specified variable
  249. <li>Table containing all variables if no variable name is given
  250. </ol>
  251. </dd>
  252. <dt><a name="hostname"></a><strong>hostname</strong>&nbsp;(String)</dt>
  253. <dd>
  254. Get or set the current hostname.
  255. <h3>Parameters</h3>
  256. <ul>
  257. <li>
  258. String: containing a new hostname to set (optional)
  259. </li>
  260. </ul>
  261. <h3>Return value:</h3>
  262. String containing the system hostname
  263. </dd>
  264. <dt><a name="httpget"></a><strong>httpget</strong>&nbsp;(url, stream, target)</dt>
  265. <dd>
  266. Returns the contents of a documented referred by an URL.
  267. <h3>Parameters</h3>
  268. <ul>
  269. <li>
  270. url: The URL to retrieve
  271. </li>
  272. <li>
  273. stream: Return a stream instead of a buffer
  274. </li>
  275. <li>
  276. target: Directly write to target file name
  277. </li>
  278. </ul>
  279. <h3>Return value:</h3>
  280. String containing the contents of given the URL
  281. </dd>
  282. <dt><a name="mounts"></a><strong>mounts</strong>&nbsp;()</dt>
  283. <dd>
  284. Retrieve information about currently mounted file systems.
  285. <h3>Return value:</h3>
  286. Table containing mount information
  287. </dd>
  288. <dt><a name="reboot"></a><strong>reboot</strong>&nbsp;()</dt>
  289. <dd>
  290. Initiate a system reboot.
  291. <h3>Return value:</h3>
  292. Return value of os.execute()
  293. </dd>
  294. <dt><a name="syslog"></a><strong>syslog</strong>&nbsp;()</dt>
  295. <dd>
  296. Retrieves the output of the "logread" command.
  297. <h3>Return value:</h3>
  298. String containing the current log buffer
  299. </dd>
  300. <dt><a name="uniqueid"></a><strong>uniqueid</strong>&nbsp;(bytes)</dt>
  301. <dd>
  302. Generates a random id with specified length.
  303. <h3>Parameters</h3>
  304. <ul>
  305. <li>
  306. bytes: Number of bytes for the unique id
  307. </li>
  308. </ul>
  309. <h3>Return value:</h3>
  310. String containing hex encoded id
  311. </dd>
  312. <dt><a name="uptime"></a><strong>uptime</strong>&nbsp;()</dt>
  313. <dd>
  314. Returns the current system uptime stats.
  315. <h3>Return value:</h3>
  316. String containing total uptime in seconds
  317. </dd>
  318. </dl>
  319. </div> <!-- id="content" -->
  320. </div> <!-- id="main" -->
  321. <div id="about">
  322. <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
  323. </div> <!-- id="about" -->
  324. </div> <!-- id="container" -->
  325. </body>
  326. </html>