1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
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"/-->
14 <div id="product_logo"></div>
15 <div id="product_name"><big><b></b></big></div>
16 <div id="product_description"></div>
17 </div> <!-- id="product" -->
27 <li><a href="../index.html">Index</a></li>
38 <a href="../modules/luci.dispatcher.html">luci.dispatcher</a>
42 <a href="../modules/luci.http.html">luci.http</a>
46 <a href="../modules/luci.http.protocol.html">luci.http.protocol</a>
50 <a href="../modules/luci.http.protocol.conditionals.html">luci.http.protocol.conditionals</a>
54 <a href="../modules/luci.http.protocol.date.html">luci.http.protocol.date</a>
58 <a href="../modules/luci.http.protocol.mime.html">luci.http.protocol.mime</a>
62 <a href="../modules/luci.i18n.html">luci.i18n</a>
66 <a href="../modules/luci.ip.html">luci.ip</a>
70 <a href="../modules/luci.ip.cidr.html">luci.ip.cidr</a>
74 <a href="../modules/luci.json.html">luci.json</a>
78 <a href="../modules/luci.jsonc.html">luci.jsonc</a>
82 <a href="../modules/luci.jsonc.parser.html">luci.jsonc.parser</a>
86 <a href="../modules/luci.model.ipkg.html">luci.model.ipkg</a>
90 <a href="../modules/luci.model.uci.html">luci.model.uci</a>
94 <a href="../modules/luci.rpcc.html">luci.rpcc</a>
98 <a href="../modules/luci.rpcc.ruci.html">luci.rpcc.ruci</a>
101 <li><strong>luci.sys</strong></li>
104 <a href="../modules/luci.sys.init.html">luci.sys.init</a>
108 <a href="../modules/luci.sys.iptparser.html">luci.sys.iptparser</a>
112 <a href="../modules/luci.sys.net.html">luci.sys.net</a>
116 <a href="../modules/luci.sys.process.html">luci.sys.process</a>
120 <a href="../modules/luci.sys.user.html">luci.sys.user</a>
124 <a href="../modules/luci.sys.wifi.html">luci.sys.wifi</a>
128 <a href="../modules/luci.util.html">luci.util</a>
132 <a href="../modules/nixio.html">nixio</a>
136 <a href="../modules/nixio.CHANGELOG.html">nixio.CHANGELOG</a>
140 <a href="../modules/nixio.CryptoHash.html">nixio.CryptoHash</a>
144 <a href="../modules/nixio.File.html">nixio.File</a>
148 <a href="../modules/nixio.README.html">nixio.README</a>
152 <a href="../modules/nixio.Socket.html">nixio.Socket</a>
156 <a href="../modules/nixio.TLSContext.html">nixio.TLSContext</a>
160 <a href="../modules/nixio.TLSSocket.html">nixio.TLSSocket</a>
164 <a href="../modules/nixio.UnifiedIO.html">nixio.UnifiedIO</a>
168 <a href="../modules/nixio.bin.html">nixio.bin</a>
172 <a href="../modules/nixio.bit.html">nixio.bit</a>
176 <a href="../modules/nixio.crypto.html">nixio.crypto</a>
180 <a href="../modules/nixio.fs.html">nixio.fs</a>
195 </div><!-- id="navigation" -->
199 <h1>Class <code>luci.sys</code></h1>
210 <table class="function_list">
213 <td class="name" nowrap><a href="#call">call</a> (...)</td>
216 Execute a given shell command and return the error code
221 <td class="name" nowrap><a href="#dmesg">dmesg</a> ()</td>
224 Retrieves the output of the "dmesg" command.</td>
228 <td class="name" nowrap><a href="#exec">exec</a> (command)</td>
231 Execute a given shell command and capture its standard output
236 <td class="name" nowrap><a href="#getenv">getenv</a> (var)</td>
239 Retrieve environment variables.</td>
243 <td class="name" nowrap><a href="#hostname">hostname</a> (String)</td>
246 Get or set the current hostname.</td>
250 <td class="name" nowrap><a href="#httpget">httpget</a> (url, stream, target)</td>
253 Returns the contents of a documented referred by an URL.</td>
257 <td class="name" nowrap><a href="#mounts">mounts</a> ()</td>
260 Retrieve information about currently mounted file systems.</td>
264 <td class="name" nowrap><a href="#reboot">reboot</a> ()</td>
267 Initiate a system reboot.</td>
271 <td class="name" nowrap><a href="#syslog">syslog</a> ()</td>
274 Retrieves the output of the "logread" command.</td>
278 <td class="name" nowrap><a href="#uniqueid">uniqueid</a> (bytes)</td>
281 Generates a random id with specified length.</td>
285 <td class="name" nowrap><a href="#uptime">uptime</a> ()</td>
288 Returns the current system uptime stats.</td>
302 <h2><a name="functions"></a>Functions</h2>
303 <dl class="function">
307 <dt><a name="call"></a><strong>call</strong> (...)</dt>
311 Execute a given shell command and return the error code
329 <h3>Return value:</h3>
330 Error code of the command
339 <dt><a name="dmesg"></a><strong>dmesg</strong> ()</dt>
343 Retrieves the output of the "dmesg" command.
352 <h3>Return value:</h3>
353 String containing the current log buffer
362 <dt><a name="exec"></a><strong>exec</strong> (command)</dt>
366 Execute a given shell command and capture its standard output
374 command: Command to call
384 <h3>Return value:</h3>
385 String containg the return the output of the command
394 <dt><a name="getenv"></a><strong>getenv</strong> (var)</dt>
398 Retrieve environment variables. If no variable is given then a table
400 containing the whole environment is returned otherwise this function returns
401 the corresponding string value for the given name or nil if no such variable
409 var: Name of the environment variable to retrieve (optional)
419 <h3>Return values:</h3>
422 <li>String containg the value of the specified variable
424 <li>Table containing all variables if no variable name is given
435 <dt><a name="hostname"></a><strong>hostname</strong> (String)</dt>
439 Get or set the current hostname.
447 String: containing a new hostname to set (optional)
457 <h3>Return value:</h3>
458 String containing the system hostname
467 <dt><a name="httpget"></a><strong>httpget</strong> (url, stream, target)</dt>
471 Returns the contents of a documented referred by an URL.
479 url: The URL to retrieve
483 stream: Return a stream instead of a buffer
487 target: Directly write to target file name
497 <h3>Return value:</h3>
498 String containing the contents of given the URL
507 <dt><a name="mounts"></a><strong>mounts</strong> ()</dt>
511 Retrieve information about currently mounted file systems.
520 <h3>Return value:</h3>
521 Table containing mount information
530 <dt><a name="reboot"></a><strong>reboot</strong> ()</dt>
534 Initiate a system reboot.
543 <h3>Return value:</h3>
544 Return value of os.execute()
553 <dt><a name="syslog"></a><strong>syslog</strong> ()</dt>
557 Retrieves the output of the "logread" command.
566 <h3>Return value:</h3>
567 String containing the current log buffer
576 <dt><a name="uniqueid"></a><strong>uniqueid</strong> (bytes)</dt>
580 Generates a random id with specified length.
588 bytes: Number of bytes for the unique id
598 <h3>Return value:</h3>
599 String containing hex encoded id
608 <dt><a name="uptime"></a><strong>uptime</strong> ()</dt>
612 Returns the current system uptime stats.
621 <h3>Return value:</h3>
622 String containing total uptime in seconds
635 </div> <!-- id="content" -->
637 </div> <!-- id="main" -->
640 <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>
641 </div> <!-- id="about" -->
643 </div> <!-- id="container" -->