Tripp Lite B092-016 Owner's Manual Page 188

  • Download
  • Add to my manuals
  • Print
  • Page
    / 242
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 187
188
When an alert occurs on a port, the portmanager will attempt to execute
/etc/config/scripts/portXX.alert
(where XX is the port number, e.g. 08)
.
The script is run with STDIN containing the data which triggered
the alert, and STDOUT
redirected to /dev/null, NOT to the serial port
.
If you wish to communicate with the port,
use
pmshell
or
pmchat
from within the script.
If the script cannot be executed, then the alert will be mailed to the address configured in
the
system administration section.
III.
When a user connects to any port:
If a file called
/etc/config/pmshell
-
start.sh
exists
,
it is run when a user connects to a port. It
is provided
with
2 arguments, the "Port number" and the "Username". Here is a simple
exampl
e:
</etc/config/pmshell
-
start.sh
>
#!/bin/sh
PORT="$1"
USER="$2"
echo "Welcome to port $PORT $USER"
<
/etc/config/pmshell
-
start.sh>
The return value from the script controls whet
her the user is accepted or not
.
I
f 0 is
returned (or nothing is done on
exit as in the above script)
,
then
the user is permitted,
otherwise
,
the user is denied access.
Here is a more complex script which reads from configuration to display the port label if
available and denies access to the root user:
</etc/config/pmshell
-
start.sh>
#!/bin/sh
PORT="$1"
USER="$2"
LABEL=$(config
-
g config.ports.port$PORT.label | cut
-
f2
-
-
d' ')
if [ "$USER" == "root" ]; then
echo "Permission denied for Super User"
exit 1
Page view 187
1 2 ... 183 184 185 186 187 188 189 190 191 192 193 ... 241 242

Comments to this Manuals

No comments