Instruction Manual
109
example:
</etc/cong/pmshell-start.sh>
#!/bin/sh
PORT=”$1”
USER=”$2”
echo“Welcometoport$PORT$USER”
</etc/cong/pmshell-start.sh>
The return value from the script controls whether the user is accepted or
not, if 0 is returned (or nothing is done on exit as in the above script) 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/cong/pmshell-start.sh>
#!/bin/sh
PORT=”$1”
USER=”$2”
LABEL=$(cong-gcong.ports.port$PORT.label|cut-f2--d’‘)
if[“$USER”==“root”];then
echo“PermissiondeniedforSuperUser”
exit1
if[-z“$LABEL”];then
echo“Welcome$USER,youareconnectedtoPort$PORT”
else
echo“Welcome$USER,youareconnectedtoPort$PORT($LABEL)”
</etc/cong/pmshell-start.sh>