From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96490222905486.tru64-unix-managers.marc@archive.invalid> From: "Alan C. Davis" Date: Sat, 29 Jul 2000 20:26:18 +0000 To: tru64-unix-managers Subject: addendum to ifalias script X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96490222905486 Addendum to ifalias script posting. Sorry for the omission. This is the content of site.rc and site_lib.sh used by the ifalias script posted yesterday. # site.rc -- this file holds site specific env vars # and is referenced by various scripts # this file must use only the sh(1p) subset of sh/ksh syntax # the name of the script executing stripped of the path # this needs to be before the check for site.rc in each script # PROGNAME=${0##[./]*/} # ksh only # PROGNAME=`/usr/bin/basename $0` # set hostname for single user mode HOSTNAME=`/usr/sbin/rcmgr get HOSTNAME | /usr/bin/cut -f1 -d'.'` export HOSTNAME # locations of scripts and programs SBINDIR=/local/bin BINDIR=/usr/local/bin ETCDIR=/local/etc export SBINDIR BINDIR ETCDIR # admin email ADMIN_EMAIL=sysadmin export ADMIN_EMAIL # pagers : used by critpage PAGER1="`/usr/bin/cat /local/etc/oncall_admin.txt`" PAGER2=xyz@mobilecomm.net export PAGER1 PAGER2 # Set node-specific env variables and functions if [ -r /local/etc/node.rc ] then . /local/etc/node.rc fi # Get common functions for site if [ -r /local/etc/site_lib.sh ] then . /local/etc/site_lib.sh fi ---------- cut here ------------------------------ # site_lib.sh ###################################################################### # common functions ###################################################################### # paging functions assume an email gateway to the pagers # display an error message perror () { msg=$1 echo "$PROGNAME : $msg" } # page the critical pagers # usage : critpage severity "message" critpage () { severity=$1 msg=$2 oncall=`cat /local/etc/oncall_admin.txt` /usr/bin/mailx -r pager@tessco.com -s "$HOSTNAME" $oncall <>/var/adm/critpage.log } # mail error event status # usage : critmail severity "recipients" "message" [file] critmail () { severity=$1 maillist=$2 msg=$3 data=$4 oncall=`cat /local/etc/oncall_admin.txt` if [ -z "$4" ] then /usr/bin/mailx -s "$severity : $HOSTNAME : $PROGNAME $msg" $maillist <