Code: Select all
[xxxxxxxx@xxxxxxxxx] > ip hotspot user print where name=mj1997
Flags: * - default, X - disabled, D - dynamic
# SERVER NAME ADDRESS PROFILE UPTIME
0 ;;; hi mj1997 unlimited 3h24m8s
Code: Select all
[Marcelo1997@Archer-C64] > :foreach ITEM in=[/ip hotspot user find where name="mj1997"] do={
{... :local COMMENT [/ip hotspot user get $ITEM comment];
{... :put "$COMMENT";
}
hi
Code: Select all
:foreach ITEM in=[/ip hotspot user find where name="$username"] do={
:local COMMENT [/ip hotspot user get $ITEM comment];
:put "$COMMENT";
}
now I want this script to run on status.html and print user's comment
please help me make it work
status.html code
Code: Select all
<form action="$(link-logout)" name="logout" onSubmit="return openLogout()">
<table class="table table-bordered table-hover mr-b-0 text-light">
<tr>
<td align="right" style="width: 40%;">IP address </td>
<td>$(ip)</td>
</tr>
<tr>
<td align="right">MAC address</td>
<td>$(mac)</td>
</tr>
<tr>
<td align="right">Wifi connected to</td>
<td>$(interface-name)</td>
</tr>
$(if vlan-id == yes)
<tr>
<td align="right">Vlan id</td>
<td>$(vlan-id)</td>
</tr>
$(endif)
$(if login-by == http-chap)
<tr>
<td align="right">Was login</td>
<td>manually typed</td>
</tr>
$(elif login-by == mac-cookie)
<tr>
<td align="right">Was login</td>
<td>automatically<br>Was logout due<br>to no activity</td>
</tr>
$(elif login-by == cookie)
<tr>
<td align="right">Was login by</td>
<td>login back button</td>
</tr>
$(endif)
<tr>
<td align="right"> Uploaded data<br> Downloaded data</td>
<td>$(bytes-in-nice) <br> $(bytes-out-nice)</td>
</tr>
<tr>
<td align="right">Active time</td>
<td>$(uptime)</td>
</tr>
$(if remain-bytes-total)
<tr>
<td align="right">Remaining data</td>
<td>$(remain-bytes-total-nice)</td>
</tr>
$(endif)
$(if session-time-left)
<tr>
<td align="right">Remaining Time</td>
<td>$(session-time-left)</td>
</tr>
$(endif)
$(if blocked == 'yes')
<tr>
<td align="right">Status</td>
<td><div style="color: #FF8080"><a href="$(link-advert)" target="hotspot_advert"></a> advertisement</div></td>
</tr>
$(endif)
<tr>
<td align="right">Refreshing in</td>
<td>$(refresh-timeout)</td>
</tr>
</table>
$(if login-by-mac != 'yes')
<button type="submit" class="btn-md w-12 bg-red pd-5">Logout</button>
$(endif)
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>