#!/bin/sh # The following was generated from # NLS/en/adm.gen # MF_ADM=adm.cat@Unix # MS_PROFILE=1 MSG_MAIL=1 : # @(#) profile.sh 26.1 95/07/25 # # Copyright (C) 1988-1995 The Santa Cruz Operation, Inc. # All Rights Reserved. # The information in this file is provided for the exclusive use of # the licensees of The Santa Cruz Operation, Inc. Such users have the # right to use, modify, and incorporate this code into other products # for purposes authorized by the license agreement provided they include # this notice and the associated copyright notice with any such product. # The information in this file is provided "AS IS" without warranty. # #ident "@(#)adm:profile 1.10" trap "" 1 2 3 umask 022 # # Verifica accesso utenti remoti per linea seriale - E.G. 030500 # if [ `tty` = /dev/ttyA14 -o `tty` = /dev/ttyA09 -o `tty` = /dev/ttyA13 ] then # Protected tty echo Verifica Accesso ... ok=0 for i in nppp do [ $LOGNAME = $i ] && ok=1 done if [ $ok = 0 ] then echo $LOGNAME Non Autorizzato! sleep 2 echo `date` Accesso negato $LOGNAME - $tty >> /usr/adm/mdmlog.`date +"%a"` 2>/dev/null exit fi echo $LOGNAME Accesso Autorizzato! echo `date` Accesso al sistema $LOGNAME - $tty >> /usr/adm/mdmlog.`date +"%a"` 2>/dev/null fi # # Verifica accesso utenti remoti tramite ip - E.G. 030500 # hostname=`who -x | grep $LOGNAME | cut -c 38-` if [ -n "`echo $hostname | grep rem-terzisti`" ] then # Protected tty echo Verifica Accesso ... ok=0 for i in c do for k in 01 do [ $LOGNAME = $i$k ] && ok=1 done done # [ $LOGNAME = root ] && ok=1 if [ $ok = 0 ] then echo $LOGNAME Non Autorizzato! sleep 2 echo `date` Accesso negato $LOGNAME - $hostname >> /usr/adm/mdmlog.`date +"%a"` exit fi echo $LOGNAME Accesso Autorizzato! echo `date` Accesso al sistema $LOGNAME - $hostname >> /usr/adm/mdmlog.`date +"%a"` fi case "$0" in -sh | -rsh | -ksh | -rksh) # if not doing a hushlogin, issue message of the day, if the file is out there [ "X$HUSHLOGIN" != "XTRUE" ] && [ -s /etc/motd ] && { trap : 1 2 3 echo "" # skip a line cat /etc/motd trap "" 1 2 3 } # setting default attributes for terminal moved to ~/.profile, so # each user has individual control over these characteristics # if not doing a hushlogin, check mailbox and news bulletins if [ "X$HUSHLOGIN" != "XTRUE" ] then [ -x /usr/bin/mail ] && { # if the program is installed [ -s "$MAIL" ] && \ dspmsg $MF_ADM -s $MS_PROFILE $MSG_MAIL '\nyou have mail\n' } if [ "$LOGNAME" != "root" -a -x /usr/bin/news ] # be sure it's there then news -n fi fi ;; -su) : ;; esac