Startechcom CONYX ECS0016 Uživatelský manuál Strana 116

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 140
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 115
Instruction Manual
109
example:
</etc/cong/pmshell-start.sh>
#!/bin/sh
PORT=”$1”
USER=”$2”
echo“Welcometoport$PORT$USER”
</etc/cong/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/cong/pmshell-start.sh>
#!/bin/sh
PORT=”$1”
USER=”$2”
LABEL=$(cong-gcong.ports.port$PORT.label|cut-f2--d’‘)
if[“$USER”==“root”];then
echo“PermissiondeniedforSuperUser”
exit1

if[-z“$LABEL];then
echo“Welcome$USER,youareconnectedtoPort$PORT”
else
echo“Welcome$USER,youareconnectedtoPort$PORT($LABEL)
</etc/cong/pmshell-start.sh>
Zobrazit stránku 115
1 2 ... 111 112 113 114 115 116 117 118 119 120 121 ... 139 140

Komentáře k této Příručce

Žádné komentáře